Friday, June 17, 2011

ASP.NET 3.5 interview question 1

In Assembly which work as GacBrowser ?

The GACPicker class allows the user to select an assembly from the Global Assembly Cache. It does this by looking at the filesystem representation of the GAC, since there appears to be no actual API in the current .NET environment.

What is purpose of Assembly Linker or define SDK Tool in .NET Framework?

In .NET whole the working should be with the helps of DLLs.So all of Visual Studio .Net compilers gernate assemblies or u can say dll.If we want to create an assembly with manifest of a module.We can also put this assembly in seprate file.This AL tol gernate a file with an assembly manifest from modules or resources fles.The syntax of using Al.exe is al [sources] [options]
This tool helps in creating multi-file assembly outside Visual Studio .Net .This multi file can contain modules that are written in diffrenet langauage in one application.

Describe the term Channel in .Net Remoting

In .Net Remoting, an application use Channel to send message to another application which is runing in different domain or process. Before sending message, Channel converts message into appropriate format like XML or binary format. The channel that carries message(Mashalled parameter) can use protocal like TCP and HTTP. Channel can be HTTPChannel and TCPChannel. The HTTPChannel use soapFormatter to serialize messages into the XML format using SOAP protocal. Using SOAP method allows the client to call method on the remote object that might not be using .Net framework. The TCPChannel use binaryFormatter to serialize message into binary stream.

Describe the type of remotable objects in .Net Remoting.

Marshal-by-value-objects - When client calls a method on marshal-by-value-object, the remoting system creates a copy of this object and passes the copy to the client application domain. The copy hence received can handle any method call in client domain. Using Marshal-by-value-object reduces resource consuming trip across network.
Marshal-by-reference-object - When client calls a method on Marshal by reference object, the remoting system create proxy object in the caller application that contains the reference of all method and properties of the object.

What are the remotable and non-remotable objects in .Net Remoting.

The remotable objects are the objects which can be distributed accross domains, can be used with domain. The non-remotable objects are the objects which can't be distributed accross domains. In distributed system, if an object is very big, we can make it non-remotable object.

What security measures exist for .NET Remoting in System.Runtime.Remoting?

None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?

Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component?

When to use Web Service:

1. Communicating through a Firewall When building a distributed application with 100s/1000s of users spread over multiple locations, there is always the problem of communicating between client and server because of firewalls and proxy servers. Exposing your middle tier components as Web Services and invoking the directly from a Windows UI is a very valid option.

2. Application Integration When integrating applications written in various languages and running on disparate systems. Or even applications running on the same platform that have been written by separate vendors.

3. Business-to-Business Integration This is an enabler for B2B intergtation which allows one to expose vital business processes to authorized supplier and customers. An example would be exposing electronic ordering and invoicing, allowing customers to send you purchase orders and suppliers to send you invoices electronically.

4. Software Reuse This takes place at multiple levels. Code Reuse at the Source code level or binary componet-based resuse. The limiting factor here is that you can reuse the code but not the data behind it. Webservice overcome this limitation. A scenario could be when you are building an app that aggregates the functionality of serveral other Applicatons. Each of these functions could be performed by individual apps, but there is value in perhaps combining the the multiple apps to present a unifiend view in a Portal or Intranet.

When not to use Web Services:

1. Single machine Applicatons When the apps are running on the same machine and need to communicate with each other use a native API. You also have the options of using component technologies such as COM or .NET Componets as there is very little overhead.

2. Homogeneous Applications on a LAN If you have Win32 or Winforms apps that want to communicate to their server counterpart. It is much more efficient to use DCOM in the case of Win32 apps and .NET Remoting in the case of .NET Apps.


No comments:

Post a Comment