Sei sulla pagina 1di 2

Articles from Jinal Desai .

NET
Enterprise Library Interview Questions
2014- 01- 27 11:01:55 Jinal Desai
1. What is Enterprise Library?
Ans. Ent erprise Library is class library delivered f reely by Microsof t Pat t erns
and Pract ices group. It is made up of series of applicat ion blocks, each aimed
at managing specif ic crosscut t ing concerns f or example writ ing ent ries t o
syst em log or Windows Event Log, caching and validat ing user input , et c.
2. What are application blocks?
Ans. Applicat ion blocks are pluggable and reusable sof t ware component s
designed t o assist developers wit h common ent erprise development
challenges.
3. What are the advantages of Enterprise Library? Why to use Enterprise
Library?
Ans. First t hing f irst Ent erprise Library cont ains st andard and proven code
pract ices and component s which can save considerable amount of
development t ime in t urn minimize cost s, reduce t he use of t est resources
and also decrease overall maint enance ef f ort .
Ent erprise library is cont inuously evolving wit h t he capabilit ies of t he .NET
Framework t o ut ilize new f eat ures of .NET Framework and language
capabilit ies.
Ent erprise library embodies many design pat t erns, and demonst rat es good
archit ect ural and coding t echniques which are proven over t he t ime.
And f inally it s f ree.
4. How many application blocks are there in Enterprise Library?
Ans. There are t ot al nine applicat ion blocks in Ent erprise Library. Among nine
applicat ion blocks seven are f unct ional blocks which act ually t arget s specif ic
cross-cut t ing concerns and t wo are designed t o help in implement ing more
loosely coupled, t est able, and maint ainable syst ems.
5. Can you describe all its application blocks in one line?
Ans. Caching: It is used f or local in-memory caching or dat abase caching or
isolat ed st orage caching.
Credential Management: It provides common aut horizat ion relat ed
f unct ionalit ies such as users aut hent icat ion and aut horizat ion dat a caching
and int egrat ing wit h .NET f ramework securit y f eat ures.
Data Access: It provides f acilit y t o perf orm common dat a access t asks such
as reading dat a, passing dat a t hrough applicat ion layers and submit t ing
changed dat a back t o dat abase syst em.
Encryption: It makes easy t o incorporat e crypt ographic f unct ionalit ies such
as encrypt ing and decrypt ing dat a, creat ing a hash f rom dat a, and comparing
hash values t o verif y dat a has not been alt ered int o applicat ion.
Exception Handling: It is used t o implement unif ied model of except ion
handling t hrough out various archit ect ural layers of t he applicat ion.
Logging: It is used t o implement common logging f unct ions such as writ ing
inf ormat ions t o t he Windows Event Log or an email message or a dat abase or
Windows Message Queue, a t ext f ile, a Windows Management
Inst rument at ion (WMI) event , or a cust om locat ion.
Validation: It is used t o implement st ruct ured and easy-t o-maint ain validat ion
mechanisms using at t ribut es and rule set s.
6. Why we need to conf igure Enterprise Library? What is conf iguration
tool?
Ans. Ent erprise Library uses conf igurat ion sources t o expose conf igurat ion
inf ormat ion t o t he applicat ion blocks and t he core f eat ures of t he library. The
conf igurat ion sources can read conf igurat ion f rom st andard .NET
conf igurat ion f iles (such as App.conf ig and Web.conf ig), f rom ot her f iles, f rom
a dat abase, and can also t ake int o account Group Policy rules f or a machine
or a domain.
Ent erprise Library includes a st and-alone conf igurat ion console (GUI t ool) t hat
int egrat es wit h Microsof t Visual St udio. We can access conf igurat ion console
by right clicking on conf igurat ion f ile and click on Edit Ent erprise Library V(5/6)
Conf igurat ion menu it em.
7. Can you describe mechanism behind instantiating Enterprise Library
objects?
Ans. Ent erprise Library 5.0 uses dependency inject ion cont ainer t o generat e
inst ances. There are t wo approaches recommended t o creat ing inst ances.
First and simple approach of obt aining inst ances is using Ent erprise Library
service locat or. It provides access t o t he Unit y cont ainer t hat holds t he
Ent erprise Library conf igurat ion inf ormat ion. Alt ernat ively, if we are already a
DI convert , we can t ake charge of t he ent ire process by creat ing and
populat ing a cont ainer and using it t o creat e and manage bot h Ent erprise
Library object s and your own cust om t ypes.
8. Can you write down simple example of both?
Ans. Yes sure. First one is simple approach, using Ent erprise Library service
locat or.
//To instantiate LogWriter
var writer = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();
writer.Write("I'm a log entry created by the Logging block!");
//To instantiate specific database object
var customerDb = EnterpriseLibraryContainer.Current.GetInstance<Database>("Customers");
Second one is using DI convert .
//To initialize and populate the default Unity container
var theContainer = new UnityContainer().AddNewExtension<EnterpriseLibraryCoreExtension>();
//To instantiate LogWriter
var writer = theContainer.Resolve<LogWriter>();
//To instantiate specific database object
var customerDb = theContainer.Resolve<Database>("Customers");
9. Whats new in Enterprise Library 5.0?
Ans. In Ent erprise Library 5.0 f ollowing are major enhancement provided.
Major archit ect ural ref act oring t o provide improved t est abilit y and
maint ainabilit y t hrough dependency inject ion st yle of development . You
can even replace Unit y (t hat ships wit h Ent erprise Library) wit h a
cont ainer of your choice.
Asynchronous dat a access support .
Int egrat ion wit h WPF validat ion mechanism.
Opt imized cache scavenging.
Support f or t he .NET 4.0 Framework and int egrat ion wit h Microsof t Visual
St udio 2010.
Dat a accessors f or more int uit ive processing of dat a query result s.
Programmat ic conf igurat ion support , including a f luent conf igurat ion
int erf ace and an XSD schema t o enable Int elliSense.
Ent erprise Library Int erview Quest ions
0.00
/
5
5
1 / 5
2 / 5
3 / 5
4 / 5
5 / 5
0 votes, 0. 00 avg. rating (0% score)

Potrebbero piacerti anche