Dot Net

What is MVC pattern?

The main purpose using MVC pattern is to decouple the GUI from the Data. It also gives the ability to provide multiple views for the same Data. MVC pattern separates objects in to three important sections:-

?   Model: – This section is specially for maintaining data. It is actually where your business logic, querying database, database connection etc. is actually implemented.

?   Views: – Displaying all or some portion of data, or probably different view of data. View is responsible for look and feel, Sorting, formatting etc.

?   Controller: – They are event handling section which affects either the model or the view. More >

What is the difference between Factory and Abstract Factory Patterns?

First read the definition provided in the first question about both these patterns. The common thing they have is that they belong to creational patterns. In short they hide the complexity of creating objects.

The main difference between factory and Abstract factory is factory method uses inheritance to decide which object has to be instantiated while abstract factory uses delegation to decide instantiation of object. We can say Abstract factory uses factory method to complete the architecture. Abstract Factory is one level higher in abstraction over Factory.

The   two class diagrams below will provide overview of what is the actual difference. First figure More >

Can you list down all patterns and their classification ?

There are three basic classification of patterns Creational, Structural and Behavioral patterns.

Creational Patterns

?   Abstract Factory:- Creates an instance of several families of classes

?   Builder :- Separates object construction from its representation ?   Factory Method:- Creates an instance of several derived classes ?   Prototype:- A fully initialized instance to be copied or cloned ?   Singleton:- A class in which only a single instance can exist

Note :- The best way to remember Creational pattern is by ABFPS (Abraham Became First President of States).

Structural Patterns

?   Adapter:-Match interfaces of different classes.

?   Bridge:-Separates an object’s interface from its implementation. ?   Composite:-A tree structure of simple More >

What are design patterns ?

Design patterns are recurring solution to recurring problems in software architecture.

What is the main difference between Gridlayout and FlowLayout ?

GridLayout provides absolute positioning for controls placed on the page. Developers that have their roots in rich-client development environments like Visual Basic will find it easier to develop their pages using absolute positioning, because they can place items exactly where they want them. On the other hand, FlowLayout positions items down the page like traditional HTML. Experienced Web developers favor this approach because it results in pages that are compatible with a wider range of browsers.

If you look in to the HTML code created by absolute positioning you can notice lot of DIV tags. While in Flow layout you can More >

How do we configure “WebGarden”?

“Web garden” can be configured by using process model settings in “machine.config” or “Web.config” file. The configuration section is named <processModel> and is shown in the following example. The process model is enabled by default (enable=”true”). Below is the snippet from config file.

<processModel

enable=”true”

timeout=”infinite”

idleTimeout=”infinite”

shutdownTimeout=”0:00:05″ requestLimit=”infinite” requestQueueLimit=”5000″ memoryLimit=”80″

webGarden=”false” cpuMask=”12″ userName=”” password=””

logLevel=”errors”

clientConnectedCheck=”0:00:05″

/>

From the above processmodel section for web garden we are concerned with only two attributes “webgarden” and “cpuMask”.

webGarden :- Controls CPU affinity. True indicates that processes should be affinitized to the corresponding CPU. The default is False.

cpuMask:- Specifies which processors on a multiprocessor server are eligible to run ASP.NET processes. The cpuMask value More >

What is the difference between “Web farms” and “Web garden”?

“Web farms” are used to have some redundancy to minimize failures. It consists of two or more web server of the same configuration and they stream the same kind of contents. When any request comes there is switching / routing logic which decides which web server from the farm handles the request. For instance we have two servers “Server1” and “Server2” which have the same configuration and content. So there is a special switch which stands in between these two servers and the users and routes the request accordingly.

What are the steps to create a windows service in VB.NET ?

Windows Services are long-running executable applications that run in its own Windows session, which then has the ability to start automatically when the computer boots and also can be manually paused, stopped or even restarted.

Following are the steps to create a service :-

?   Create a project of type “Windows Service”.

How to use a checkbox in a datagrid?

Following are the steps to be done :-

?   In ASPX page you have to add Itemtemplate tag in datagrid. <ItemTemplate>

<asp:CheckBox id=”CheckBox1″ runat=”server” AutoPostBack=”True” OnCheckedChanged=”Check_Clicked”></asp:CheckBox>

</ItemTemplate>

?   If you look at the Itemtemplate we have “OnCheckChanged” event. This “OnCheckChanged” event has “Check_Clicked” subroutine is actually in behind code. Note this method which is in behind code should either be “protected” or “public”

?   Following below is the subroutine which defines the method

Protected Sub Check_Clicked(ByVal sender As Object, ByVal e As EventArgs) ‘ do something

End Sub

The above steps should be defined in short to the interviewer which will give a quick feeling of your practical More >

If cookies are not enabled at browser end does form Authentication work?

No, it does not work.