Thursday, September 30, 2004

Find Memory Leaks and Optimize Memory Usage in Programs Written in C#, VB.NET or Any Other .NET Language

This post is an update to my previous post on Circular References / Memory Leaks /other baddies.

Having a garbage collected runtime removes one of the biggest sources of program errors, memory allocation errors. Unfortunately, memory leaks are still a reality. A memory leak can occur if an instance is unintentionally being referenced from some other long-living instance, or from a static field. In this case the instance cannot be garbage collected. A very common unintentional reference is an event handler that is never removed.

Here is a .NET Memory Profiler as claimed by the vendors, that helps locate instances that are being referenced unintentionally, and it will tell why the instance has not been garbage collected.

Circular References / Memory Leaks /other baddies

In a garbage collected environment such as .NET, it is possible to unwittingly leave objects in a state where the garbage man will be "on vacation". A good article at EggHeadcafe by Peter Bromberg. Also a related article in Ian Griffith's blog. Both these articles give a good insight to the GC and strongly referenced objects.

Wednesday, September 29, 2004

THE TECHWEB SPIN: The Best Technology Blogs

Weblogs are in such profusion that it would be impossible for one person to do a survey, unless that person drank massive amounts of coffee and devoted many months to the project, full-time.
An interesting article on blogs by Mitch Wagner at TechWeb.

Monday, September 27, 2004

CNUG Celebrations Experiences

This post is an update to my post on CNUG's Anniversary celebrations in my other blog. The event was a great success with 300+ students and developers attanding the Technical Sessions and other events. Though the number dwindled in the afternoon sessions, the reponse was quite good.

Vadivel, a .NET MVP speaks his observations about the event in his blog - CNUG 2nd year celebrations ...

I would like to share the credits he gives with JD Arun, without whom I would have not been able to work for the event's success. Thanks to Anand, for giving me an opportunity to be a part of the event.

.NET 1.1 SP1 breaking existing apps reported

.NET v1.1 SP1 is reported to break existing apps.

Check the details out at .NET 1.1 SP1 breaking existing apps reported

Thursday, September 23, 2004

How do I become an Architect

This is one of the basic questions that has been pinching me for a long time, 'What do I need to become an Architect?' Many I times I have wondered to whom I can pose this question and get answered. After I read this post I understood that there are people who are baffled just like me and yes, I got answered.

Plethora of Information on XP SP2

Came across this page on the net while surfing. A good collection of links and info on XP SP2, JMF's XP Service Pack 2 Page

This post in my other blog gives a hint on an Undocumented XP SP2 issue - XP SP2 vs. Intel Prescott.

Wednesday, September 22, 2004

Efficient paging of recordsets with T-SQL

One of the challenges the Developers face is implementing efficient paging mechanism in case of large data. Jeff gives an efficient solution to Efficient paging of recordsets with T-SQL.

Adding to this, Richard is giving a code-based solution here.... Both have their own advantages and disadvantages as listed by Richard in his blog.

Tuesday, September 21, 2004

Top 10 Reasons .NET is better than COM

Why is .NET better than COM? A Serverside presentation gives top ten reasons as an answer for this question. Top 10 Reasons .NET is better than COM

Microsoft to share Office code with govts

Today's Times Of India NEws reads like this.... "Microsoft Corp has said it would share source code of its MS Office desktop software with more than 60 governments, including China and Russia."

Read the full story here...

Thursday, September 16, 2004

DSML Services for Windows

Directory Service Markup Language combines directory services technology (LDAP) with XML syntax to provide an easy way to share and use personalized data across company and technology boundaries.

DSML Services for Windows (DSfW) extends the power of the Active Directory® service. Because DSML Services for Windows uses open standards such as HTTP, XML, and SOAP, a greater level of interoperability is possible. For example, in addition to the already standard Lightweight Directory Access Protocol (LDAP), many devices and other platforms have other alternatives to communicate with Active Directory. This provides a number of key benefits for IT administrators and independent software vendors (ISVs), who can now have even more open-standard choices to access Active Directory.

Blogging with DotNetJunkies

I have started my second WebLog Mahalakshmi Natarajan with DotNetJunkies.

I am actually planning to post regularly in both these blogs with interesting and useful information as I have been doing in this blog all these days.

Tuesday, September 14, 2004

Model Driven Architecture(MDA)

This post intends to give info on MDA, further to my post on Formal Methods, UML & OCL.

MDA stands for Model Driven Architecture. It is framework defined by OMG for software development. It is an approach to creating designs that can cope with multiple technology deployments of a software system and is based on widely used standards like the Unified Modeling Language (UML). The intention of the MDA is to create machine-readable models that can be understood by automatic tools that generate schemas, code skeletons, testing models, test packs, and integration code for multiple platforms and technologies.

The central idea of the MDA is to develop and maintain an abstract design of a system that can be automatically transformed into multiple platform designs and finally transformed into the code that will realize those deployments. The core of the MDA depends on the three models that are created as part of the software development process, namely,
  1. Platform Independent Model - The PIM is a highly abstracted model that is independent of any implementation technology. It describes a software system that supports a part, or the whole, of business. The PIM may include generic functions, scenarios and class descriptions.
  2. Platform Specific Model - Using the PIM as a foundation it is then transformed into one or more platform specific models, which describes in detail how the PIM is implemented on a specific platform, or technology. Depending on the platforms across which the software system is going to be deployed PSM's will be created - one per platform, or technology. It is common to have many PSM's per PIM.
  3. Code - The detailed designs defined in the PSM's are then transformed into code in the final step of the MDA software development process.
The whole basis is MDA is a tools-based approach. While one or two hardy pioneers have implemented MDA using only a UML modelling tool, a text editor and a steely determination to keep their code and models synchronised, most of the benefits of MDA actually come from having generators to create code, test scripts, database schemas and other development artifacts directly from models. Some researchers and consultants have built their own model transformation tools, and there are some interesting work from a couple of people on using XSLT to transform models expressed in OMG's XMI (XML Metadata Interchange) exchange format. However, for most people, implementing MDA involves buying a vendor's MDA tool. However, because MDA is based on standards like UML, XMI and MOF (Meta Object Facility), buying a tool doesn't mean that you're permanently locked into using only one vendor's product.
When the visions of the MDA are realized there is a number of benefits it would bring to the software development community. The two main benefits are:
  1. Productivity - The developer will focus on the development of a PIM. From the PIM the PSM's and Code will be automatically created via transformations. Because the focus is on the PIM, quite a lot of the technical details of the underlying technologies and platforms do not need to be considered. The Majority of the code will be created through the automated transformation process and as such relatively small parts of code will need to be written (Yes! Coding will still happen). With less focus on the coding and detail design for specific platforms, the developers can spend more time in accommodating business problems. This will ensure better business fit and hopefully a happier user community.
  2. Portability - Portability is achieved via the PIM that is transformed into PSM's for the multiple platforms on which deployment will take place. With the transformation between PIM and PSM automated the PIM becomes totally portable.

There are a number of downsides to the MDA as it exists currently. They are:

  1. Current tools (if they exist?) for automatic transformation from PIM to PSM are not yet sophisticated enough. These automated transformation tools will rely heavily on transformation definitions and rules.
  2. The PIM's, if defined loosely, might not deliver the systems required. To ensure that the PIM's and subsequent PSM's and Code align with business requirements, the PIM's need to be defined precisely. Imprecise definitions will lead to faulty and incomplete systems that may create a huge maintenance overhead.
  3. Portability (in the future), trough transformation from PIM to PSM will probably be cater for the popular platforms, but for the less popular platforms may still remain an issue. Emerging technologies may also be plagued by not having automated transformation tools available in early stages of release
Early-adopters are already using MDA very effectively on real applications, and this will increase over the next few years as major suppliers like Sun, IBM and Microsoft ship MDA tools to their customers. Sun and IBM already provide some MDA support via Netbeans and Eclipse, and there are strong hints that Microsoft will soon ship model-driven tools, including this speech by Bill Gates.

MS Releases Authentication & Access Control tool for ASP.NET

Microsoft has released a new tool to help identify authentication and access control issues in ASP.NET for Web sites, FTP sites, virtual directories, Web directories, and files. This tool not only will help to identify current issues but can be used to monitor authentication failures as they happen.

Read More Here...

Download the different versions here...
X86
IA64
AMD64

Monday, September 13, 2004

Object Spaces and NHibernate

Database interaction via the FCL centers around retrieving a static snapshot of some portion of the database and manipulating it via the dataset, which mimics the RDBMS in almost every way. The problem with the dataset is that it doesn’t fit particularly well with modern object-oriented application design. Whereas datasets have tabular data, we tend to code using objects. Datasets have foreign key relationships, our domain objects use references. Where we want to use only methods, datasets require a certain amount of SQL code. Of course, some of these problems can be solved through the use of “strongly typed” datasets, but the fact remains that you are changing modes as you move from your domain model to your data access and back again. Depending on how you choose to layer that data access code into the application, changes to the data store can have enormous ripple-effects on your codebase.

The key to any enterprise application today is the domain model that needs to be transparent. It is in these classes that your customers’ problems are addressed; everything else is just a service to support the domain, things like data storage, message transport, transactional control, etc. Transparency means that your model benefits from those services without being modified by them. It shouldn’t require special code in your domain to utilize those services, it shouldn’t require specific containers, or interfaces to implement. Which means that your domain architecture can be 100% focused on the business problem at hand, not technical problems outside the business. A side effect of achieving transparency is that you can replace services with alternate providers or add new services without changing your domain. Coding directly against the dataset breaks the transparency. It is obvious inside of your code what storage mechanism you use, and it affects the way your code is written. Another approach to storage is the use of an object-relational mapping tool. Microsoft is in the process of building such a framework, called ObjectSpaces, but recently announced it would be delayed until as far as 2006.

NHibernate, an open source solution, is available today and solves the same set of problems. With NHibernate, your code and your data schema remain decoupled, and the only visible indicator of the existence of the O/R layer are the mapping files. With HNibernate, you’ll see that these consist of configuration settings for the O/R framework itself (connecting to a data source, identifying the data language, etc.) and mapping your domain objects to the data tables.

NHibernate Article on TheServerSide.NET

Read more on Object Spaces here...
Download the Source from SourceForge.NET

Friday, September 10, 2004

A Quick Scripting Tip

I have been trying some WMI scripting recently and thought could post the scripts that I found useful and the ones that I succeeded executing. Here is one. This script helps the Administrator to find out which scripting technologies have been installed in the PC.

On Error Resume Next
WScript.Echo "WSH Version: " & WScript.Version
Wscript.Echo "VBScript Version: " & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion
compName = "."
Set wmiServcObject = GetObject("winmgmts:" &"{impersonationLevel=impersonate}!\\" & compName & "\root\cimv2")

Set colWMISettings = wmiServcObject.ExecQuery & ("Select * from Win32_WMISetting")
For Each objWMISetting in colWMISettings
Wscript.Echo "WMI Version: " & objWMISetting.BuildVersion
Next
Set shellObject = CreateObject("WScript.Shell")
adsiVersionIns = shellObject.RegRead("HKLM\SOFTWARE\Microsoft\Active Setup\
Installed Components\{E92B03AB-B707-11d2-9CBD-0000F87A369E}\Version")
If adsiVersionIns = vbEmpty Then
adsiVersionIns = shellObject.RegRead("HKLM\SOFTWARE\Microsoft\ADs\Providers\LDAP\")
If adsiVersionIns = vbEmpty Then
adsiVersionIns = "ADSI is not installed."
Else
adsiVersionIns = "2.0"
End If
End If
WScript.Echo "ADSI Version: " & adsiVersionIns

If you want to have the latest versions of the Scripting Technologies:

ADSI:http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp WMI:http://www.microsoft.com/downloads/release.asp?ReleaseID=18490
WSH/VBScript:http://msdn.microsoft.com/downloads/list/webdev.asp

Thursday, September 09, 2004

An Introduction to WMI

I have been involved with CNUG's IT chapter for quite sometime. Recently we had a session on Windows Scripting, since then I got interested in exploring it. I was browsing the net for some script help, I came across this link. A good article for An Introduction to WMI.

SQL2K Record Concurrency Control

When many people attempt to modify data in a database at the same time, a system of controls must be implemented so that modifications made by one person do not adversely affect those of another person. This is called concurrency control.

Concurrency control is usually implemented in two ways:

Pessimistic concurrency control
A system of locks prevents users from modifying data in a way that affects other users. After a user performs an action that causes a lock to be applied, other users cannot perform actions that would conflict with the lock until the owner releases it. This is called pessimistic control because it is mainly used in environments where there is high contention for data, where the cost of protecting data with locks is less than the cost of rolling back transactions if concurrency conflicts occur.

Optimistic concurrency control
In optimistic concurrency control, users do not lock data when they read it. When an update is performed, the system checks to see if another user changed the data after it was read. If another user updated the data, an error is raised. Typically, the user receiving the error rolls back the transaction and starts over. This is called optimistic because it is mainly used in environments where there is low contention for data, and where the cost of occasionally rolling back a transaction outweighs the costs of locking data when read.

In real world application Optimistic Concurrency Control is preferred than Pessimistic Concurrency control, except for situations stated.

I happened to read a solution based on timestamps for optimistic concurrency control implementation at Vadivel's blog. Read it here...

Wednesday, September 08, 2004

Throwing Exceptions

A quick tip on catching and throwing exceptions.

General way of throwing exceptions:

try
{
-----------------------

your code
-----------------------
}
catch(Exception ex)
{
----any clean up activities-----

throw ex;
}

Recommended way of throwing exceptions:

1. If you want to just do some cleanup when an exception occurs, you should re-throw the caught exception using this code instead:

catch(Exception)
{
---- clean up activities -----;
throw;
}


This preserves the original calling stack. Nobody knows you were involved, and they can trace back to the exception from its true origin without being diverted into your cleanup code. the above examle belongs to this category.

2. If you want to be part of the exception chain, then you should re-package the exception with your own, and assign the old one as the inner exception:

catch(Exception exception)
{
---clean up activities -----;
throw new MyException(exception);
}


You turn the general exception into a specific one, while preserving the original inner exception so that it can continue to be traced back to the origin.

Convert Java ByteCode to .NET IL

IKVM.NET is an implementation of Java for .NET. It has the following components:
  • A Java Virtual Machine implemented in .NET
  • A .NET implementation of the Java class libraries
  • Tools that enable Java and .NET interoperability

IKVM.NET includes ikvmc, a Java bytecode to .NET IL translator. If you have a Java library that you would like to use in a .NET application, run ikvmc -target:library mylib.jar to create mylib.dll.
For example, the Apache FOP project is an open source XSL-FO processor written in Java that is widely used to generate PDF documents from XML source. With IKVM.NET technology, Apache FOP can be used by any .NET application.

Read more here.....

Microsoft's Biggest Competitor

This is an entry in Sriram's blog today all about computerization. A good read and thought provoking...!!!
Read it here...

Tuesday, September 07, 2004

WebSites and Programs you can't live without!!!

Cool entries in Scott's Blog

Web Sites Can't You Live Without
Programs You Can't Live Without

Why the name Whidbey for Visual Studio 2005

Happened to visit Arun's MVP blog where I found this interesting post including the answer to the question Why the name Whidbey for VS 2005.
Blog from ArunGanesh_ MVP: Session - Whidbey - Visual Studio 2005

Also more Microsoft codenames from here...

Deepak talks on Localization support in WinXP

Deepak Gulati a localization freak talks about its support in WinXP here. The first time I listened to him speaking on this topic is at the CNUG's first year anniversary celebrations last year and after that a couple of time at Microsoft events. Here is a video in which he demonstrates his favorite topic.
Deepak Gulati - Working with ISV's in India

Chasing the hash code

An interesting and useful entry at Sriram's Weblog.

Madurai Usergroup in THE HINDU

India's leading Newspaper has spoke about Kaushik, a Microsoft Student Ambassador from Madurai and the USergroup he moderates. Read this at http://www.hindu.com/lf/2004/09/02/stories/2004090200560200.htm

Thanks to Sriram for this info.

Upgrade to SQL Server 7.0 from Yukon!!

I was going through Anand's Blog where I found this... funny indeed!!!

.NET From India: Upgrade to SQL Server 7.0 from Yukon!!

Friday, September 03, 2004

XML style guidelines for leveraging schema validators

Used correctly, XML Schema validation can dramatically reduce the effort necessary to perform basic data validation tasks. Additionally, validation rules that are centrally located in an XML schema can help users to better understand your system. It takes the right XML structure, however, to leverage a schema validator. This article discusses proper XML structure as well as best and worst practices for defining data validation rules in XML Schema.

How do you keep invalid data from getting into your system? Should you hand-code validation routines that perform bounds checking? With the XML entry points into your system, XML Schema validators can save you an incredible amount of time in this area. This goes for DTD validators as well as those for XML Schema.

Read more here...

Formal Methods, UML and OCL

I am now studying formal methods wherein I have come across something interesting I thought I could share with people.

Formal Methods is the application of logic to the development of "correct" systems. They are mathematical foundations for many technologies and practices that software engineers use. Joseph Goguen says that formal methods are “syntactic in essence but semantic in purpose.” A more narrower definition could be "A formal method in software development is a method that provides a formal language for describing a software artifact (e.g. specifications, designs, source code) such that formal proofs are possible, in principle, about properties of the artifact so expressed."

UML is one of the tools Engineers use to design more formal systems. This language fits Goguen’s description of a formal method. It is syntactic in essence, offering a well-defined way to construct a model. It is also semantic in purpose — that is, it is designed to convey meaning. Much information can be encoded in a UML model. But it is not always easy to construct syntactically correct and semantically rich models of software using just UML diagrams. The rules for which type of arrowhead and which type of connector to use for which purpose can be just as confusing as the syntax for a programming language such as Java. And then, even if you can construct a correct UML diagram, there is much information that it will not convey.
However, OCL, a formal specification language that is part of the UML specification, enables you to annotate models with expressions that clarify meaning. In UML 1.1, the main purpose of OCL was to identify the constraints on model elements. More on this...

Helping the Small Blogs...

There are by some estimates more than a million weblogs. But most of them get no visibility in search engines. Only a few “A-List” blogs get into the top search engine results for a given topic, while the majority of blogs just don’t get noticed. The reason is that the smaller blogs don’t have enough links pointing to them. But this posting could solve that. Let’s help the smaller blogs get more visibility!

This posting is GoMeme 4.0. It is part of an experiment to see if we can create a blog posting that helps 1000’s of blogs get higher rankings in Google. So far we have tried 3 earlier variations. Our first test, GoMeme 1.0, spread to nearly 740 blogs in 2.5 days. This new version 4.0 is shorter, simpler, and fits more easily into your blog.

Why are we doing this? We want to help thousands of blogs get more visibility in Google and other search engines. How does it work? Just follow the instructions below to re-post this meme in your blog and add your URL to the end of the Path List below. As the meme spreads onwards from your blog, so will your URL. Later, when your blog is indexed by search engines, they will see the links pointing to your blog from all the downstream blogs that got this via you, which will cause them to rank your blog higher in search results. Everyone in the Path List below benefits in a similar way as this meme spreads. Try it!

Instructions: Just copy this entire post and paste it into your blog. Then add your URL to the end of the path list below, and pass it on! (Make sure you add your URLs as live links or HTML code to the Path List below.)

Path List

Minding the Planet
Luke Hutteman’s public virtual MemoryStream
Mohammad.Abdulfatah, Chronicles Of
Anand M, DotNet From India
Mahalakshmi N, Mahalax's Blog
(your URL goes here! But first, please copy this line and move it down to the next line for the next person).
(NOTE: Be sure you paste live links for the Path List or use HTML code.)

Thursday, September 02, 2004

Sun, Microsoft Take Different Tracks on File Systems

Sun has come out with a File system what they call DFS(Dynamic File System).

At a release event on Tuesday, Sun Microsystems made a number of announcements about its latest operating system, Sun Solaris 10, including the official announcement of its new DFS (Dynamic File System). Solaris 10 is still in beta, and is available to customers via the Sun Software Express program. I am yet to read about this DFS and its way of resource management, compatibility and performance.

You could have more info here...

Windows XP SP2 affects SQL/MSDE access

Windows XP SP2 is the most recent service pack for the Windows XP operating system. Windows XP SP2 includes fixes and updates that include a set of security technologies designed to help reduce the risk of malicious attacks against computer systems. Windows XP SP2 includes Windows Firewall, an enhanced version of the component previously known as Internet Connection Firewall (ICF). Windows Firewall is a host-based, stateful, filtering firewall that discards unsolicited incoming traffic through TCP/IP version 4 (IPv4) and TCP/IP version 6 (IPv6) connections. Windows XP SP2 enables Windows Firewall on all network connections by default.

All above these Windows XP SP2 security features affects SQL Server and MSDE.

http://www.microsoft.com/sql/techinfo/administration/2000/security/winxpsp2faq.asp


Wednesday, September 01, 2004

Microsoft strips Longhorn of WinFS

Just came across this news today

http://www.newratings.com/new2/beta/article_462483.html

The most awaited LongHorn release for its WinFS, Avalon and Indigo... Now that Microsoft has said that Avalon and Indigo will be available with XP and Win2K3 and is stripping of WinFS from LongHorn, then what is going to so special of LongHorn.