Microsoft Pattern and Practices Enterprise Library  (FAQ & Overview)

General Question

What is Enterprise Library

It is collection of reusable configurable and flexible classes that solved repetitive task such as opening/closing data bases, logging etc in plug and play style.   

What is the current release 

5.0 is the latest release

What purpose it solve 

It reduces the overall development time by providing out of box solution for crosscutting concerns like data access, logging , security etc. A feature analysis can be found here 

What are main consumers of this library

Any one who is developing enterprise level solution and need adopt a rapid development approach.

What are the main component of the library

How does this library works 

  • Library request container (Unity) to provide a particular service object like Database
  • Unity looks for DI/PI and return a particular application block (such as database) 
  • Client can use this instance to get the services exposed by instance (such as query/update to database)

What is Container in reference of Enterprise Library 

Container can be assumed as very advance version of object factory where object factory creates object and forgot but containers creates object and do complex task like life cycle management, service location , and runtime dependency resolution. It can be viewed as a complex configurable factory + object manager.

What is "Enterprise Library objects"

Theses are conceptual object such as Database that hides level details and provide uniform way of performing intended task 
                     Database db = EnterpriseLibraryContainer.Current.GetInstance<Database>("QuickStarts Instance");

How many ways we can get service object in EntLib

There are two way using default Using the Enterprise Library service locator and Using the container as the service locator both has there own pros and cons as below 
Object instantiation technique Advantages Considerations
Using the Enterprise Library service locator Requires no initialization code. The service locator is made available automatically.

You can resolve types anywhere in your application code. You don't need to hold onto a reference to the container.
You can only resolve Enterprise Library types (as interfaces, abstract types, or concrete types that are registered automatically).

You cannot manipulate, or add registrations or mappings to the container.
Using the container as the service locator You can directly access all the functionality of the Unity container.

You can iterate over the contents and read or manipulate the registrations and mappings (though you should not attempt to change the Enterprise Library configuration information).

You can add and remove your own registrations and mappings, allowing you to take full advantage of DI techniques.
Requires initialization, though this is simply one line of code executed at application startup, or simple configuration settings, when you use the default Unity container.

Request-based applications such as ASP.NET and Web services require additional code to store the container reference and resolve the dependencies of the request class (such as the Page).

Data Access Application Block

What is Data Accessors 

  • It is a mechanism that translate raw data row to strongly typed business entities i.e domain model.
  • Accessors accept information that is required to extract the data, and mappings that indicate how the input parameters correspond to the parameters of the underlying query. 
  • They use output mappings that define how the returned columns map to the properties of the objects the developer wants to work with, and return a sequence of objects of the specified type.
  • Data Accessors are designed for querying data only, and not for updating it. They are not designed to provide an Object-Relational Mapping (ORM) solution.  Read "Returning Data as Objects for Client Side Querying "

Does DAAB support Asynchronous data access 

In Enterprise Library 5.0, the only database type that supports asynchronous operation is the SqlDatabase class.The Database class exposes a Boolean property named SupportsAsync that you can check at run time to determine if asynchronous operations are supported. 

Unity Container 

What is Unity container ?

Unity container that holds the Enterprise Library configuration information. It provide required information to service locator how to find a particular service instance object such as Database

Cache Application Block

Advance Question 

Entity Framework Vs Data Access Application Block

More Advance FAQ at codeplex