Monday, December 7, 2009

MOSS - Microsoft Office SharePoint Server 2007 - I

According to wikipedia "Sharepoint is a browser-based collaboration and document management platform from Microsoft."

The word sharepoint refers to both Windows Sharepoint Services 3.0 (WSS) and Microsoft Office Sharepoint Server 2007 (MOSS).

Windows SharePoint Services 3.0 (WSS)

1. Used for storage and web presentation.
2. Authorization/user management.
3. Interface to WWF (Windows Workflow Foundation).
4. APIs (Application Programming Interfaces) & web services that can be extended by developers.
5. Collaboration tools and functionality.

For more info on WSS

Microsoft Office Shareoint Server 2007 (MOSS)

MOSS comes in 2 versions - MOSS 2007 Standard and MOSS 2007 Enterprise.

MOSS 2007 Standard (provides all functionality available in WSS with the below mentioned features)

* Portal templates for building your internet/intranet site.
* User profiles, social networking and my sites.
* Web parts for aggregating information.
* Enterprise search.
* Web content Management (WCM).
* Additional built-in workflow templates.

MOSS 2007 Enterprise (provides all the functionality available in standard version, with additional features)

* BDC - Business Data Catalog
* Forms Server
* Excel Services
* Additional Web Parts

Saturday, August 1, 2009

.NET FAQs - 1

1. What is Lamda Expression?

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types. All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read "x goes to x times x." This expression can be assigned to a delegate type as follows:

delegate int del(int i);
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 25

To create an expression tree type:


using System.Linq.Expressions;


Example :




The => operator has the same precedence as assignment (=) and is right-
associative. Lambdas are used in method-based LINQ queries as arguments to standard query operator methods such as Where``1(IEnumerable(UMP), Func(UMP, Boolean)).

The general rules for lambdas are as follows:

The lambda must contain the same number of parameters as the delegate type. Each input parameter in the lambda must be implicitly convertible to its corresponding delegate parameter.

The return value of the lambda (if any) must be implicitly convertible to the delegate's return type.


2. Difference between clustered and non-clustered index


The difference is that, Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db.


3. What is Microsoft UIP?


The User Interface Process Application Block provides a simple yet extensible
framework for developing user interface processes. It is designed to abstract
the control flow and state management out of the user interface layer into a user interface process layer. This helps you write generic code for the control flow and state management for different applications types (for example, Web and Windows) and helps manage user's tasks in complex scenarios (for example, suspending and resuming tasks).

The UIP Application Block is based on the model-view-controller (MVC) pattern. Each of the MVC objects is represented in the UIP Application Block in the following ways:

Model — Implemented in the State class. This stores both user information and control information within the user interface process.
View — Implemented in the WebFormView, WindowsFormView, and
WindowsFormControlView classes.

These are used to create views in your application.

Controller — Implemented in classes that derive from the ControllerBase abstract class. These classes are responsible for the starting of, navigation within, and ending of a user interface process.

4. Difference between WCF and Webservice.

WCF is much more flexible:

can be used over HTTP (like legacy ASMX) but also: can be used over NetTCP, MSMQ, wsHttp and so on WCF services can be hosted in IIS (like legacy ASMX)
but WCF services can also be self-hosted in a console app, Windows NT Service,
etc.

WCF offers a lot more security features and security levels than ASMX (message
security etc.). WCF offers things like reliable messaging, transaction support etc. In WCF, almost anything is configurable in a config file - much more so than with ASMX

5. Why do we need 3-Tier architecture?

i. Reusability of the business logic component results in quick development.Let's say we have a module that handles adding, updating, deleting and finding customers in the system. As this component is developed and tested, we can use it in any other project that might involve maintaining customers.

ii.Transformation of the system is easy. Since the business logic is separate from the data access layer, changing the data access layer won t affect the business logic module much. Let's say if we are moving from SQL Server data storage to Oracle there shouldn t be any changes required in the business layer component and in the GUI component.

iii.Change management of the system is easy. Let's say if there is a minor change in the business logic, we don t have to install the entire system in individual user s PCs. E.g. if GST (TAX) is changed from 10% to 15% we only need to update the business logic component without affecting the users and without any downtime.

iv. Having separate functionality servers allows for parallel development of
individual tiers by application specialists. Provides more flexible resource allocation. Can reduce the network traffic by having the functionality servers strip data to the precise structure needed before sending it to the clients.

6. New features of .NET 3.5 Framework

1. .NET Compact Framework

Windows Communication Foundation (WCF) technology
Language-Integrated Query (LINQ)
Improvements made to Windows Forms controls
SoundPlayer to play multiple sounds.
Supports Compression through the System.IO.Compression namespace
Supports the CreateDelegate method
Supports the CLR Profiler
Supports the Configuration Tool (which provides runtime version information and
administrative functions)
Debugging enhancements
Improvements have been made to logging features
Information about the platform type

The runtime tools library with diagnostic tools, such as Remote Performance
Monitor, with the emulator. Strong names that are greater than 1,024 bytes are now supported The global assembly provides improved error handling and integration with
Windows Embedded CE version 6.0.

The class library documentation improved

2. ASP.NET

ListView Class


ListView Class displays the values of a data source by using user-defined templates. The ListView control enables users to select, sort, delete, edit, and insert records. The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0.

DataPager


Provides paging functionality for data-bound controls that implement the IPageableItemContainer interface, such as the ListView control.he best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.DataPager gives you a consistent way of paging with the controls that support it.

3. Add-Ins and Extensibility
4. Common Language Runtime
5. Cryptography
6. Networking
7. Windows Communication Foundation
8. Windows Presentation Foundation
9. Windows Workflow Foundation
10. Windows Forms
11. LINQ
12. Expression Trees
13. Programming Languages

Please refer http://www.tipsntracks.com/11/new-features-in-the-dotnet-framework-version-35.html for detailed explanation.

7.LINQ to SQL Implementation

LINQ to SQL is an O/RM (object relational mapping) implementation which allows you to model a relational database using .NET classes. You can then query the database using LINQ, as well as update/insert/delete data from it.

LINQ to SQL allows .NET developers to write “queries” in their .NET language of choice to retrieve and manipulate data from a SQL Server database. In a general sense, LINQ to SQL allows us to create SQL queries in our preferred .NET language syntax and work with a strongly types collection of objects as a return result. We can make changes to these objects then save changes back to the database.

EX: (HookedOnLINQ - DB name, Contact- table name)
HookedOnLINQ db =
new HookedOnLINQ("Data Source=(local);Initial Catalog=HookedOnLINQ");

var q = from c in db.Contact
where c.DateOfBirth.AddYears(35) > DateTime.Now
orderby c.DateOfBirth descending
select c;

foreach(var c in q)
Console.WriteLine("{0} {1} b.{2}",
c.FirstName.Trim(),
c.LastName.Trim(),c.DateOfBirth.ToString("dd-MMM-yyyy"));

Output:
Mack Kamph b.17-Sep-1977
Armando Valdes b.09-Dec-1973

8.New features of .NET 2.0 Framework

Various aspects such as Support for 64 bit platform application development, Access control list support (ACL), ADO.NET, ASP.NET, Authenticated streams,COM Interop Service Enhancements, Console Class Additions, Data Protection API, Detecting changes in Network connectivity, Disjunctive Demands, Distributed Computing, EventLog Enhancements, Expanded Certificate Management, FTP Support, Generics and Generic Collection, I/O Enhancements and several other features.

For detailed description:

http://www.programmersheaven.com/2/new-DotNET-Framework-v2

9. Features of SQL Server Integration Services(SSIS):

1. Enterprise-Ready Platform

SQL Server Integration Services (SSIS) provides out-of-the-box enterprise-class scalability options with its advanced data-integration pipeline architecture,
high-performance processing, and native support for 64-bit platforms.

2. Developer Productivity

SQL Server Integration Services, Analysis Services, and Reporting Services all use a common Microsoft Visual Studio–based development environment, the SQL Server Business Intelligence Development Studio, for streamlined productivity.

3. Extensible and Customizable

SSIS goes beyond simple extraction, transformation, and loading (ETL) tools by enabling nontraditional scenarios and leveraging the power of the Microsoft .NET platform and SQL Server

SQL Server Integration Services (SSIS) is a component of Microsoft SQL Server 2005 and 2008. It replaces Data Transformation Services, which has been a feature of SQL Server since Version 7.0. Unlike DTS, which was included in all versions, SSIS is only available in the "Standard" and "Enterprise" editions.

Integration Services provides a platform to build data integration and workflow applications. The primary use for SSIS is data warehousing, as the product features a fast and flexible tool for data extraction, transformation, and loading (ETL). The tool may also be used to automate maintenance of SQL Server databases, update multidimensional cube data, and perform other functions.

Tutorial:

http://sqlserverpedia.com/wiki/SQL_Server_Integration_Services_Section

10. Sql Server Reporting Services

SQL Server Reporting Services (SSRS) is a server-based report generation software system from Microsoft. It can be used to prepare and deliver a variety of interactive and printed reports. It is administered via a web interface.

Reporting services features a web services interface to support the development
of custom reporting applications.

SSRS competes with Crystal Reports and other business intelligence tools, and
is included in Express, Workgroup, Standard, and Enterprise editions of Microsoft SQL Server as an install option. Reporting Services was first released in 2004 as an add-on to SQL Server 2000. The second version was released as a part of SQL Server 2005 in November 2005. The latest version was released as part of SQL Server 2008 in August 2008.

In SSRS, reports are defined in Report Definition Language (RDL), an XML markup
language. Reports can be designed using recent versions of Microsoft Visual Studio[1] with the included Business Intelligence Projects plug-in installed or with the included Report Builder, a simplified tool that does not offer all the functionality of Visual Studio. Reports defined by RDL can be generated in a variety of formats[2] including Excel, PDF, CSV, XML, TIFF (and other image formats[3]), and HTML Web Archive. SQL Server 2008 SSRS can also prepare reports in Microsoft Word (DOC) format.

Tutorial: http://sqlserverpedia.com/wiki/SQL_Server_Reporting_Services_Section

11. Design Patterns

All design patterns have the following characteristics …

A name
A description of the problem being addressed
A description of the solution
An evaluation of the pattern's consequences (i.e. its trade-offs)
As software developers and architects, why should we care about design
patterns?

Design patterns provide a common vocabulary, and therefore facilitate communication.

Design patterns provide templates or guidelines for solving common design problems.

Design patterns help us understand the consequences of our design decisions. If we study design patterns and understand when they should be applied, we can build better products, and in the process bring benefit to our respective companies, our projects, our teams, and ourselves as well. Rather than reinventing the wheel, we can learn from our predecessors, and that's the key to building better software!

Types:

I .GOF (Gang of Four) -The GOF book catalogued 23 design patterns into 3

groups, namely Creational, Structural and Behavioural

Creational


Abstract Factory
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.


Builder
Separate the construction of a complex object from its representation so that the same construction process can create different representations.


Factory Method
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.


Prototype
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

Singleton
Ensure a class only has one instance, and provide a global point of access to it.

Structural

Adapter
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

Bridge
Decouple an abstraction from its implementation so that the two can
vary independently.

Composite
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

Decorator
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

Façade
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

Flyweight
Use sharing to support large numbers of fine-grained objects efficiently.

Proxy
Provide a surrogate or placeholder for another object to control access to it.


Behavioural


Chain Of Responsibility
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.


Command
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

Interpreter
Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

Iterator
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

Mediator
Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.

Memento
Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.

Observer
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.


State
Allow an object to alter its behaviour when it’s internal state changes. The object will appear to change its class.


Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.


Template Method
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

Visitor
Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

II. Environmental Design Pattern

III. Architectural Design Pattern

Architectural or Enterprise design patterns tend to focus at higher abstractions of implementation. In other words, a typical Architecture design pattern would be the 'Three-Layered Architecture'. This simply means that one tries to separate ones implementation in terms of three focused areas or layers (Presentation, Business Logic, and Data Access). At the Enterprise level, one would start looking at Integration Patterns and understanding what patterns are useful in terms of connecting disparate systems in a hybrid environment.

WCF Vs WebServices

WCF

1. DataContractSerializer is used for data transition.

2. File extension is .svc

3. The WCF uses the DataContractAttribute and DataMemeberAttribute to translate .NET FW types in to XML.

4. Public/Private fields or properties of .NET types can be translated.

5. The DataContractSerializer can translate the Hash Table into XML. Hence using WCF we can even translate HashTable into XML.

6. The main benefit of the design of the DataContractSerializer is better performance over XML serialization.

7. DataCotractSerializer Explicitly shows the which fields or properties are serialized into XML.

8. In WCF Services, unhandled exceptions are not returned to clients as SOAP faults. A configuration setting is provided to have the unhandled exceptions returned to clients for the purpose of debugging.

[ServiceContract]
public interface ITest
{
[OperationContract]
string ShowMessage(string strDemo);
}
public class Service : ITest
{
public string Demo(string strDemo)
{
return strDemo;
}
}


ASP.NET Web Service

1. To and from Data Transition is done through XML Serializer.

2. File extention is asmx.

3. ASP.NET WebService uses Webmethods to to translate .NET FW types in to XML.
4. Only Public fields or Properties of .NET types can be translated into XML.Only the classes which implement IEnumerable interface, ICollection interface can be serializable.

5. Classes that implement the IDictionary interface, such as Hash table can not be serialized.

6. Slower compared to WCF.

7. XMLSerialization does not indicate the which fields or properties of the type are serialized into XML.

8. In ASP.NET Web services, Unhandled exceptions are returned to the client as SOAP faults.

[WebService]
public class Service : System.Web.Services.WebService
{
[WebMethod]
public string Demo(string strDemog)
{
return strDemo;
}
}

Wednesday, June 3, 2009

LINQ Data Sources - Part I

There is a huge buzz involved about LINQ post .NET Framework 3.5 release. I have shared some useful information on using LINQ(Language-Integrated Query) data sources.

Introduction:

1. LINQ gives a set of query operators that are available as C# Keywords. Those keywords will be used to denote/define an expression ie. Query Expression that retrieves tha data you want.

2. Source data for a query must implement IEnumerable interface or interface that implements IEnumerable like IQueryable

3. Datasource of LINQ can be array or an array list that supports non-generic IEnumerable interface.

Example of LINQ to Objects(LINQ Implementation)

LINQ query that retrieves key values from a sorted list

Mark List

SortedList markList = new SortedList();
markList.Add("Karthick", 80);
markList.Add("Dheeraj"85);
markList.Add("Wendy"60);
markList.Add("Kiah",65);

so the query expression to select the names from the list:

var nameList= from names in markList
select names.Key;

To execute the query the code is:

string strName=string.Empty;
foreach (var name in nameList)
strName+= name + "\n";
MessageBox.Show(strName,"Names from the list");

Important C# keywords for LINQ:

from -> Retrieves source of data for a query
where -> Tells which elements are retrieved from the data source
orderby ->For sorting
select -> Return contents
group -> Group by (aggregate on groups).
join -> Connecting data from two data sources

Using LINQ with SQL Server

Step 1: Object model creation that maps to the data model of the database.
Step 2: Query definition
Steo 3: Query Execution

Example

Code to use LINQ to query the EmployeeDetails table in EmployeeList database

EmployeeList db=new EmployeeList();

var employees=from employee in db.EmployeeDetails
where employee.Age >25
orderby employee.EmployeeID
select new
{

employee.EmployeeID,
employee.EmployeeName,
employee.Age
};

GridView1.DataSource =employees;
GridView1.DataBind();

Object Model provides a measure as a link between objects used by application and objects in a relational database. Object model can be written in C#.

i. Object Relational Designer can be used to create object model.

ii. Implementation of LINQ to work with relational DB is called as LINQ to SQL.(Till date LINQ to SQL can be used with only SQL Server DB).

iii. LINQ to SQL can insert, update, delete and select data.

Use of Object Relational Designer will be shared in Part-II.

Friday, April 10, 2009

Where does the economy heading to?

There is a debate running all over the globe, where does the economy heading?

It is going to be again the US or the economy heads to India, China?

Even Cisco is starting a huge setting up of a second head office in bangalore which will give 10,000 people jobs in India. Microsoft, IBM also want to move out of US if US restricts them with lot of policies.





China being the greatest and huge exporter of hardware, while chinese design the hardware and indians design the software the US going to consume.

There is such a mayhem and creating a mindset of all negative thoughts into the poor employees who work putting their hearts & souls and in the end they are shown doors by injecting new traumas like cost cutting, recession etc...



Major IT companies are starting to walk out of US due to their labor restrictions,tax terms etc..also there is a real factor

For example:

1. If you hire a US citizen - Annual cost is $100,000
2. If you hire a foreign worker - " " " $50,000
3. If you hire an offshore worker - $10,000

So this is factor which tends to move more project to countries like India, china & brazil..

Also India has the world's huge number of english speaking persons compared to other countries. You can see in recession also in Asia-pacific region India is giving the highest salary hike of 10.2%, while in US the unemployment rate is 10%, 21 banks going bankrupted, millions get laid-off but still it leads the economy chart with #1 (how is this possible is my question in my mind)...

There is a huge decrement in the number of applications received for h1 visas this year for 2010, indian students opting for US universities decreased by 9%...

Bail out, Investment Planning,Wealth Managers, Account Managers, Software Engineers, Human Resources etc... but no one can't do anything and there should be some approach to fight this recession....

Lot of failures are due to lack of communication, lot of problems are due to misunderstandings, the 150 years old Lehman brothers got bankrupted was the starting point and 21 banks in US in 2008 bankrupted, millions laid-off with double-digit unemployment rate etc.. but economists, Mr.Obama are sure this is a temporary and something sure is for permanent is on the way!!!

Stay Positive....