26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure: - 8. 3 Data flow between MVC architectures.<br />

(A)How can we implement singleton pattern in .<strong>NET</strong>?<br />

Singleton pattern mainly focuses on having one and only one instance of the object running.<br />

Example a windows directory service which has multiple entries but you can only have<br />

single instance of it through out the network.<br />

Note:- May of developers would jump to a conclusion saying using the “STATIC” keyword<br />

we can have a single instance of object. But that’s not the real case there is something more<br />

that has to be done. But please note we can not define a class as STATIC, so this will not<br />

serve our actual purpose of implementing singleton pattern.<br />

Following are the three steps needed to implement singleton pattern in .<strong>NET</strong>:-<br />

154

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!