Learn IT

Free learning anything to everything in Information Technology.

SQL Cache Dependency in ASP.NET 2.0

SQL cache dependencies is a new feature in ASP.NET 2.0 which can automatically invalidate a cached data object (such as a Dataset) when the related data is modified in the database. So for instance if you have a dataset which is tied up to a database tables any changes in the database table will invalidate the cached data object which can be a dataset or a data source.

Steps to enable SQL Cache Dependency in ASP.NET 2.0
  • Enable notifications for the database.

  • Enable notifications for individual tables.

  • Enable ASP.NET polling using "web.config" file.

  • Finally use the Cache dependency object in your ASP.NET code.

Benefits and Limitations of using Cookies

Benefits
  • No server resources are required as they are stored in client.

  • They are light weight and simple to use.

Limitations

  • Most browsers place a 4096-byte limit on the size of a cookie, although support for 8192-byte cookies is becoming more common in the new browser and client-device versions available today.

  • Some users disable their browser or client device’s ability to receive cookies, thereby limiting the use of cookies.

  • Cookies can be tampered and thus creating a security hole.

  • Cookies can expire thus leading to inconsistency.

Object pooling in .NET

COM+ reduces overhead by creating object from scratch. So in COM+ when object is activated its activated from pool and when its deactivated it’s pushed back to the pool. Object pooling is configures by using the "ObjectPoolingAttribute" to the class.

ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)
Public Class testingclass
Inherits ServicedComponent
Public Sub DoWork()
' Method contents go here.
End Sub
End Class

Above is a sample code which has the "ObjectPooling" attribute defined. Below is a sample code which uses the class.

Public Class App
Overloads Public Shared Sub Main(args() As String)
Dim xyz As New TestObjectPooling()
xyz.doWork()
ServicedComponent.DisposeObject (xyz)
End Sub
End Class

Above is a sample code which uses the object pooled object. Note the DisposeObject() This ensures its safe return to the object pool.

What is DCOM ?

DCOM differs from COM in that it allows for creating objects distributed across a network, a protocol for invoking that object’s methods, and secures access to the object. DCOM provides a wrapper around COM, hence it is a backwards compatible extension. DCOM uses Remote Procedural Calls (RPC) using Open Software Foundation’s Distributed Computing Environment.

These RPC are implemented over TCP/IP and named pipes. The protocol which is actually being used is registered just prior to use, as opposed to being registered at initialization time. The reason for this is that if a protocol is not being used, it will not be loaded.

In order to inform an object that the client is still alive, periodic pinging is used. Hence, when the client has died and no ping has been received (to refresh it) before the expiration time, the server object will perform some clean up tasks (including decrementing its reference count).

Since RPC across a network are typically slow (compared to processes residing on the same machine), DCOM sends multiple requests in the same call. For example, in COM, the program performs a QueryInterface, one interface at a time. In DCOM, multiple QueryInterfaces are all clustered into one call.

This clustering optimization trick is also used when creating an instance of the object and serializing it with data. Since these two operations usually occur together, DCOM allows one method which will perform both operations in one call without waiting for an acknowledgment from the first task before performing the second one.

Similarly, when a client pings its server object, he can do it in one call. Moreover, if there are multiple clients sending pings to multiple servers, an optimization is made where the multiple pings going to the same object are consolidated into just one ping. This is to cut down on the use of precious bandwidth used only for pinging.

The client has the control to set the computer which will be responsible for the lifetime of the object. That is to say, these objects are not created just somewhere where the system resources and access privileges allow for it.

Call security is implemented in all four ways: authentication (to prevent false clients from impersonating the true client), authorization (to insure that a client only does what it is authorized to do), data integrity (to insure that data was not tampered with during transit) and data privacy (to insure that only designated sources can read it). The security issues are handled as they are on operating systems. The client gives the server various access privileges to access memory or disk space.

How to prevent .NET DLL to be decompiled ?

By design .NET embeds rich Meta data inside the executable code using MSIL. Any one can easily decompile your DLL back using tools like ILDASM (owned by Microsoft) or Reflector for .NET which is a third party. Secondly there are many third party tools which make this decompiling process a click away. So any one can easily look in to your assemblies and reverse engineer them back in to actual source code and understand some real good logic which can make it easy to crack your application.

The process by which you can stop this reverse engineering is using "obfuscation". It’s a technique which will foil the decompilers. There are many third parties (XenoCode, Demeanor for .NET) which provide .NET obfuscation solution. Microsoft includes one that is Dotfuscator Community Edition with Visual Studio.NET.

SharePoint from a Users Perspective

From a Users perspective SharePoint is a way of making documents and folders on the Windows platform accessible over the web. The user visits the SharePoint Portal web page, and from there they can add documents, change documents & delete documents. Through this Portal, these documents are now available for discussion, collaboration, versioning and being managed through a workflow. Hence the name "Share-Point". Details about the document can be saved too, such as: who wrote it, when, for whom, its size, and version, category or target audience. These can then be used to find the document through SharePoint's Search facility. Even documents not "in" SharePoint can be included in the search engine's index so they become part of the portal. All in all, it's a great way to get stuff up on the web for users with average technical skills, and for administrators to manage the content.

SharePoint from an Administration Perspective

Administering SharePoint mainly consists of setting it up, which is much easier than you expect, adding the content, which can be just dragging and dropping in whole directory structures and files, and then organizing the files better by giving them categories or other metadata. This is done either through the Web interface or through the SharePoint Client: a program what means you can access SharePoint as a Web folder and then right-click files to select options like "edit profile". Or add files by dragging them in individually or in bulk.

Setting the security is also important, using NT accounts, either NT4 or Active Directory (or both in mixed mode) you can give users access to files/folders the same way as you do in standard Windows. Users can be grouped and the groups given access privileges to help manage this better. Also SharePoint has 3 Roles that a User or Group can be given on a particular item. Readers can see the item (i.e. document/file or folder) but not change it, Authors can see and edit items and coordinators can set security privileges for the part of the system they have control over. Thus, you could set 12 different coordinators for 12 different folder trees, and they could manage who can do what within that area only.

SharePoint from a Technical Perspective

Technically SharePoint illustrates neatly what Microsoft's .net strategy is all about: integrating Windows with the Web. Microsoft has previously made accessing stuff on a PC easier, (Windows) then on a network (NT) and now on the web (.NET). SharePoint is an application written to let a user access a web accessible directory tree called the Web Storage System.

SharePoint was written with a set of technologies that allow the programmer to pass data, functions, parameters over HTTP, the web's medium. These are XML, XSL and SOAP, to name a few.

To the user it looks easy, like Hotmail, but every time they click a button or a link, a lot has to happen behind the scenes to do what they want to do quickly and powerfully. Not as easy as you might think, but SharePoint does it for you. Accessing this Web storage system and the server itself is also done using technologies like ADO, CDO, PKMCDO, LDAP, DDSC, ADSC. SharePoint is a great example of how the Internet Platform can be extended and integrated into an existing well adopted technology, Windows.

Business Benefits of MOSS 2007

• Provide a simple, familiar, and consistent user experience.

• Boost employee productivity by simplifying everyday business activities.

• Help meet regulatory requirements through comprehensive control over content.

• Effectively manage and repurpose content to gain increased business value.

• Simplify organization-wide access to both structured and unstructured information across disparate systems.

• Connect people with information and expertise.

• Accelerate shared business processes across organizational boundaries.

• Share business data without divulging sensitive information.

• Enable people to make better-informed decisions by presenting business-critical information in one central location.

• Provide a single, integrated platform to manage intranet, extranet, and Internet applications across the enterprise.

Advanced Features of MOSS 2007

  • User Interface (UI) and navigation enhancements
  • Document management enhancements
  • The new Workflow engine
  • Office 2007 Integration
  • New Web Parts
  • New Site-type templates
  • Enhancements to List technology
  • Web Content Management
  • Business Data Catalog
  • Search enhancements
  • Report Center
  • Records Management
  • Business Intelligence and Excel Server
  • Forms Server and InfoPath
  • The “Features” feature
  • Alternate authentication providers and Forms-based authentication