About LinQ

Thursday, July 30, 2009

What is Linq

• LinQ is Language Integrated Query.

• Unified approach for querying different databases, XML files and Text files.

• Unifying the tools across layers-

C# for Presentation Transformations

- C# for Business Objects-

C# for Data Queries

Language Enhancement in C#

• Query Syntax

• Typed local variables and arrays

• Anonymous Types

• Automatic Properties

• Object Initializers

• Extension Methods

• Lambda Expression

About AJAX

About AJAX
• AJAX stands for Asynchronous JavaScript and XML.
• AJAX is become popular with Google application like Google suggestion
AJAX Components
• HTML
• CSS
• DOM
• JavaScript
• XML
• JSon
• XMLHttpAJAX Framework
• Built on top of ASP.NET 2.0, there is a valuable set of controls and services that extend the existing framework with Ajax support.
• This tier of the server framework is called the ASP.NET AJAX Server Extensions.
• The server extensions are broken up into three areas: server controls, Web Services Bridge and the Application Services Bridge.
• Each of these components interacts closely with the application model on the client to improve the interactivity of existing ASP.NET pages.

ASP.NET AJAX Server Controls
The new set of server controls add to the already impressive arsenal of tools in the ASP.NET toolbox and are predominantly driven by two main controls.
ScriptManager - is considered to be the brains of an Ajax-enabled page. One of the many responsibilities of the ScriptManager isorchestrating the regions on the page that are dynamically updated during asynchronous postbacks.

UpdatePanel - is used to define the regions on the page that are designated for partial updates.

Design Patterns Categories

About Design Patterns
Design patterns are used for day to day problems we encounter during the development of the application.
There are mainly three categories of design patterns.
• Creational Patterns
- Abstract factory (Frequently used)
- Builder
- Factory method
- Prototype-
Singleton (Frequently used)
•Structural Patterns
- Adapter
- Bridge
- Composite
- Decorator-
Façade (Frequently used)
- Flyweight
- Proxy
• Behavioral Patterns
- Chain of responsibility
- Command-
Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template method
- Visitor

Definition of DOM

DOM

• The Document Object Model, or DOM, is a way to represent HTML or XHTML data in a hierarchical structure, and also to provide programmatic access to that data.

• By using the DOM, you can manipulate individual elements of your Web pages, including content, styles, and structural information.

Brief about ADO.Net Components

ADO.Net Components
• ADO.Net is a disconnected data access framework in .net which allows to access database very efficiently and scalable.
• In ADO.Net data is represented by DataSet which is in disconnected form. (In- memory representation).
•In ADO.Net architecture consist of main four components.
- Connection (connection object is used for connecting the database)
- Command (command object is used execute SQL command or stored procedure in the database)
- Data Reader (data reader command is used for forward only, read only data access from the database)
- Data Adapter (data adapter command is used for interaction between database and dataset. It is used to fill the dataset and update the database through the dataset)
Visual Studio .Net provides two data provides.
- SQL data provider
- OleDb data provider

Difference between overloading and overriding

Difference between overloading and overriding

Overloading: - In overloading we can create the multiple methods having same name but different signature.

Overloaded methods can have same or different return type and access levels.

Overriding: - In overriding we change the behavior of base class method by putting override keyword in child class. We can hide the implementation of base class by putting new keyword in child class method.

About Unit Testing

Unit Testing
• Unit testing is used for testing the use case or unit of our application which we have developed.
• We test our use case by creating the test cases.
• In test case we defined the certain input parameter or input condition and test against our developed use case.
There are two kind of test case.

- Positive test case (proper input data and check for desired output)
- Negative test case (improper input data and handle the exceptions)

Test Driven Development using NUnit

Introduction


NUnit is a free, open-source tool for .NET that is developed as a framework which can help automate unit testing. (The same unit test framework was already available for Java and was named jUnit.)


NUnit can be downloaded from NUnit site or the SourceForge NUnit page.


Installation and Setup of NUnit


After downloading the NUnit from either of the above download pages, run the installation program, NUnit-XXX.msi. At the time of this writing, the current version of NUnit is 2.2.0 and the setup file name is NUnit-2.2.0.msi. This setup will install the required libraries.

NUnit provides two utilities which can be used for running automated tests:

1. nunit-gui.exe, a GUI tool which I most commonly use, and

2. nunit-console.exe, which is a console program

Once you have installed NUnit you can test if the installation has gone through properly using the nunit-gui.exe tool.

This can be run from Start Menu --> Programs --> Nunit --> NUnit GUI.

After opening the tool, click on the File --> Open and open the nunit.tests.dll from the C:\Program Files\NUnit 2.2\bin folder. (The folder could be different if the installation has happened by choosing a different folder.)

When the DLL is chosen, NUnit-GUI shows all the unit test code written for the particular DLL using the NUnit framework.

If the button Run is clicked, it will show the results as follows.

• Passed Test - Green color

• Failed Test - Red color

• Ignored Test - Yellow color

The nunit.tests.dll DLL contains over 600 tests and when run all of them should pass and turn the color to Green.

For more details, visit http://www.nunit.org/index.php?p=home

Quick reference guide to C#

Quick referece guide to C# language
• In C# there are two kinds of variable types.
- Value Type (All value type variables are stored in stack)
- Reference Type (All reference type variables are stored in heap)
• We can use import keyword to import namespace which can be used to reference classes of that namespace in your class. We can assign the constant name to imported namespace also.
• To create new instance/object of class use new keyword.
• We can create read only and write only property in C# to extend member variables and objects.
• There are five kind of access modifier in C#.
- Private
- Public
- Protected
- Internal
- Protected Internal
• We can implement interface in c# two ways.
- Implicit (implement interface members without fully qualified name)
- Explicit (implement interface members with fully qualified name)
• Colon ( : ) is used to implement inheritance in class.
• The enum keyword used to declare an enumeration which can be numeric type only.
• In C# we can create one dimensional or multidimensional array.
• We can change the behavior of base class functionality in your child class by overriding (using override keyword) or hiding (using new keyword).
• We can access the base class functionality using base keyword.
• We can use try catch block for exception handling in our program.Structure of exception handling consists of three blocks.
1. try block
2. catch block
3. finally block (finally block will execute every time, whether exceptions occurs or not)
• In catch block we will catch any exceptions occurred during the executions of program in try block. We can use throw keyword inside a catch block to throw exceptions.
• There are three kind of error we face while working on our programs.
1. Syntax errors (compiler errors. Without fixing compiler errors we cannot move ahead in running application)
2. Run time errors (run time errors occurs when an expected operations are done on application) 3. Logical errors (logical errors occurs when application doesn’t work as per the business rules or functionality we have defined in the program)
• We use debug and trace class which allows us to trace and log message in application execution which can be useful in debugging the application.

Classification of MSMQ

Classifications of MSMQ are as below
MSMQ stands of Microsoft Message Queuing.
Application Queues
1. Message Queues- Public Queues- Private Queues
2. Administration Queues (All administration queues must be non-transaction queues)
3. Response Queues
4. Report Queues
System Queues
1. Queue journals
2. Dead-letter queues

About MTS application

About MTS application
• An MTS (Microsoft Transaction Server) application contains one or more components/objects.
• Components can be either- Server Application- Library Application
• In Server Application component executes in a separate server process.
• In Library Application component executes in process of client.

How COM works in server application and client application
Server Application
• Component executes out- of process.
• If component misbehaves it cannot kill the client.• Slower execution (Suited for web application)
Client Application
• Component executes in-process.
• If component misbehaves it can kill the client.
• Faster execution.

MTS maintains the standard COM principal of Location Transparency. Client component access a component without knowing actual physical location of component. MTS stores this information in windows registry.

Difference between XML and HTML

Definition of XML

XML is a text based markup language that is fast becoming a standard for data exchange on the web.As with web you identify data using tags, collectively the tags are known as “Markup”.
Difference between XML & HTML

• Unlike HTML, XML tags tell you what the data means, rather than how to display it. XML tag acts like a field name in your program. It puts a label on piece of data that identify it.

• XML document is always well formed.

• In HTML, there is a fixed set of tags that we can use to tell the application (web browser) how to display data (formatting of data).While in XML, you are free to use any tags that make sense for a given application. We can define tags in the same way as we define field names for a data structure.

• With HTML, whitespace is essentially irrelevant, because it gives the representation of data not contents or meaning of data.

• In XML, you could easily search a data set for messages containing “cool” in the subject, because the xml tag identifies the content of data rather than specifying its representation.

Definition of Resource Dispensers

About Resource Dispensers

MTS (Microsoft transaction server) provides resource dispensers to recycle valuable system resources in a similar fashion to the way it recycle objects.

• For example on an ODBC connection. An ODBC resource dispenser recycles database connections.

• When an ODBC database connection is no longer required MTS just deactivates connection rather than close it. When a component requires an ODBC database connection, MTS will first try to assign a connection from its pool of deactivated connections. A new one is only established only when pool is empty.

Distributed Transaction Coordinator

How DTC Works
• DTC (Distributed Transaction Coordinator) is installed with MTS. DTC is as services with is stored when system is booted.
• Where as COM provide inter object infrastructure. DTC manages transactions over the network.
• DTC inter operates with database resource manager.
• DTC also includes transactions like MSMQ – read message.
• DTC monitors transactions for any failure, if problem occurs, it will automatically handle the database rollback.

Definition of COM, COM+ and MTS

Tuesday, July 28, 2009

COM
Basic aim of COM was to reuse the code written in one language to be available to any language at binary level.
• COM exposes a standard interface that a language needs to implement to access the functionality of COM components.
• But these implementation & representation of data type are different in different languages.
• COM helped us to develop applications by assembling purchased components. We don’t have to write everything from scratch.

COM +
• COM+ extends the concept of COM to following complexities that are encountered while developing multi tier computing architecture.
- Threading issues
- Object pooling
- Transactiono Security controlled access
MTS
• MTS works as an object broker for COM+ components.
• MTS acts as a middle layer, assisting in the interoperability between client application and software components. (COM+ Components)
• It provides simple but powerful security framework for controlling who has access to the functionality within a software component. We can restrain user access to a particular object.
• Automatically manageso All threading issueso Object re-poolingo Sharing of resourceso Handling of transaction context access objects.
• Allows developer to concentrate only on business logic.

About COM threading architecture & the Apartment.

Definition of Apartment

• COM objects in the process are divided into groups called apartments.

• A COM object lives in exactly one apartment, in the sense that its methods com legally be directly called only by a thread that belongs to that apartment. Any other thread that wants to call the object must go through a proxy.

COM Threading Architecture is as below.

[PROCESS]

[Object]

Apartment

Difference between Single Threaded and Multi Threaded apartment

Single Threaded

• Single threaded apartment consist of exactly one thread.

• All COM objects that live in a single threaded apartment. COM receives method calls only from the one thread that belongs to that apartment.

• All method calls to a com objects are synchronized with the windows message queue.

• A process with a single thread is simply a special case of this mode.

Multi Threaded

• Multi threaded apartment consist of one or more thread.

• All COM objects can receive methods calls directly from any of the threads that belong to the multi-threaded apartments.

• All method calls to COM objects are synchronized by the objects themselves.

• Threads in MTA use model called free threading.

Definition of Process and Threads.

Definition of Process and Threads.
Process:-
A process is a collection of following.
• Virtual memory space
• Code
• Data
• System resources.
Thread:-
A thread is code that is to be serially executed within a process. A processor executes threads and not process. Below given is the framework of process and threads.

[Process]
• Virtual memory
• Data
[Thread]
• Primary
• Secondary

Attributes of process and threads.
• A win32 application has at least one process.
• A process has at least one thread called primary thread. A process can have multiple threads in addition to primary thread.
• Processes communicate with one another.
• A thread continues to execute until it is killed or being interrupted by a thread with higher priority.
• Each thread shares that process global variables and resources.
• A thread scheduler determines when and how often to execute a thread accordingly to a combination of the process’s priority class attribute and thread’s base priority.

Definitioin of SGML and SGML Application

Definition of SGMLSGML:-
SGML stands for Standard Generalized Markup Language
• SGML designed to make data storage independent of any software package or software vendor.
• SGML is a Meta language or a language for describing markup languages. HTML is one such markup language and is therefore called an SGML application.
SGML Application:- SGML application specifies which characters are to be interpreted as data and which characters are to be interpreted as mark up.
• An SGML application consists of an SGML declaration and an SGML DTD.

XML Structure

Types of XML structure There are two kind of structure in XML. • Physical structure• Logical structurePhysical Structure - Arrangement of entities gives a physical structure.Entity – A unit of information or a storage object. A document entity is an entity which contains all other entity. Entities can reference other entities and can cause them to be included in the XML document. They can be internal or external.e.g.

[home.page] [head] [title] [banner] [body] [main.title] [rule] [text] [para] [footer]

Logical Structure - Arrangement of the elements gives a logical structure.
Each XML doc must have only one root element and all the other elements must be perfectly nested inside that element.
This means that if an element contains other element, those elements must be completely enclosed within that element.

Hence, we can logically represent XML doc as a tree like structure with root element at the top of the tree.
• The elements that are inside an element are called its children.
• Elements that share the same parent elements are called siblings.

Sample XML doc

source=”topbanner.gif” <'main.title>Welcome to my home page Sorry, this page is still under construction. Please come back soon !



And you can use the elements accordingly to the needs of the application.

How object pooling works in MTS

How object pooling works in MTS.With standard COM, object is released whom client deletes the object or client process terminated, but with MTS (Microsoft Transaction Server), however clients can hold on to the references to objects, but the objects becomes “deactivated” for the period when their services are not required.When client needs the services of an object MTS will try to assign one from its pool of deactivated objects (if available) before resorting to the instantiation of a new object (if name is available).This increases performance of scalability because • Few objects can be shared over many clients, thus reducing the demand over system resources.• Objects can be initialized and waiting “ready to go”, this enables them to react to a request immediately on demand.For example – Database connection is a notoriously expensive operation and in large system can result in unacceptable performance levels.

Continuous Integration using Cruise Control

Saturday, July 11, 2009

Abstract
The practice of continuous integration represents a fundamental shift in the process of building software. It takes integration, commonly an infrequent and painful exercise, and makes it a simple, core part of a developer's daily activities. Integrating continuously makes integration a part of the natural rhythm of coding, Continuous integration is about progressing steadily forward by taking small steps.
About Cruise Control
Cruise Control is a framework for a continuous build process. A web interface is provided to view the details of the current and previous builds.
The CruiseControl.NET Server offers several key features:
Integration with a variety of Source Control systems
Integration with other external tools Visual Studio Team system
Can build multiple projects on one server
Remote management and reporting


Applicable areas
This is applicable to any .NET technology based development project.

CruiseControl.NET Tools
The other applications in the CruiseControl.NET suite are:
Web Dashboard: A .NET web application that gives you a status and detailed view of the CruiseControl.NET projects and servers of project.
CCTray: A client System Tray application that enables you to see 'at a glance' the state of project from any machine on your network.
Cruise Control Configuration Files
Cruise control uses ccnet.config files for the configuration.
.



Business value generated
· After implementing Continuous Integration, the entire development process is streamlined.
· The build and deployment process is automated as against manual dependency earlier faced on build manager.
· At any point in time, the management can know the status of the code quality / builds.
· The dashboard is made available to the client as well so that they now have a transparent insight in the development process.
· The developers are happy as they now know their mistakes immediately after they check in the code, rather then very late at the time of delivery. This resulted in faster turn around time.

Tools & techniques used
· CruiseControl.Net – Continuous integration tool (
http://confluence.public.thoughtworks.org/display/CCNET/)
· TFS –Version Control Tool
· VSTS 2005– IDE for ASP.NET 2.0 development
· (
http://msdn.microsoft.com/en-us/library/ms181232(VS.80).aspx)

I. Take Away
· Automation of the build process reduces resource dependency that would come with it being done manually.
· Early detection of errors and defects, which results in reduced turnaround time to fix the same.
· Increased transparency as all the stake holders have access to all the reports generated and published via the CruiseControl dashboard.
· Reduces last minute surprises in the otherwise happening integration phase, which in turn reduces risk.


II. Resources
http://confluence.public.thoughtworks.org/display/CCNET/Documentation
http://msdn.microsoft.com/en-us/vsts2008/aa718916.aspx

 
 
 
Your Ad Here