Ashraful's profileJoyPhotosBlogListsMore Tools Help

Feed

The owner hasn't specified a feed for this module yet.
April 10

Aggregator Provider Pattern: An Extension of Provider Pattern

Definition

Aggregator Provider Pattern is an extension of Provider Pattern, which enables us to create and utilize multiple instance of the class having the same provider interface. In this pattern, there is an Aggregator class which implements the provider interface and contains a collection of instances of classes having the same provider interface.

The underlying caller class of this aggregator is simply unaware of how many provider instances do the caller Provider Aggregator contains, but all of the provider instances will be utilized with a single invocation from the caller class.

image

Comparison with Provider Pattern

Provider Aggregator Pattern is fully compatible with the existing Provider Pattern and the power of provider pattern can be easily extended to use multiple providers concurrently without any modification on the caller classes that were using a provider.

In short Provider Pattern is concerned with the utilization of one of the available providers; whereas Aggregator Provider Pattern is concerned with the utilization of all of the available providers at the same time.

Example Demonstration

Aggregator Provider Pattern is useful when we need a configurable framework to add/remove multiple services used by one caller/user. For instance we can have Logger Provider framework, where we need log info to be saved at text files, save to database and sent to email addresses and so on. Having an easy configurable framework along with Aggregator Provider Pattern will enable us to add or remove more services without requiring the code modification in the code that uses this provider.

image

Regarding the example case that just been described can utilize the Aggregator Provider Pattern, by creating the classes as illustrated above. The code snippet below shows a basic usage of this pattern, where the last line will perform the log operation based in list of log providers loaded in the aggregator class dynamically.

image

Download the latest white paper and samples from MSDN Code Gallery.

 

March 11

Email Reporter: VSTS 2008 Load Test Plug-in (V1.0) Released

image

Microsoft’s Visual Studio Team System Test Edition provides a powerful platform to perform high volume load testing. It also provides high end flexibilities to write and utilize external plug-in for extended functionalities.

Email Reporter: VSTS 2008 Load Test Plug-in enables users to send the load test reports to one or more pre-configured email addresses automatically, once a VSTS Load Test is completed. This open-source load test plug-in also provides supports for customization by which you can customize the reported performance data.

Download the latest version from: http://code.msdn.microsoft.com/erep

February 05

Understanding Safe Database Synchronization

Data or content synchronization is one of the classic problems in software world. It becomes very trivial point while working on software production, where production data and schema needs to be synchronized with live data and schema. Having some basic conceptual complexity, developers often get afraid to use any automated tool considering the risk factors to lose of data or content. Mostly, in these cases a manual process has to involve making sure a safe content synchronization. However as human is also error prone, there still exists risk factor to lose of content, but also includes a huge human time and effort on it. Having a clear specific idea on content synchronization will greatly help to reduce such overheads. Although, the synchronization concept exists in disk space, network, database etc sectors, today we’ll basically focus on database synchronization concept, which will also help to understand synchronization concept from a generic point of view.

What is synchronization?

So, what is synchronization? This is a process that ensures the same content among two participating entities, having different set of content possibly.

For instance, a database table, named Employee, which has two instance on two different databases, and exact same schema definition, after a synchronization process, both table will contact the identical number of data rows and column values.

In a synchronization process, there involves two participants, generally, termed as source and destination, where the content will be placed from source entity to destination entity.

Based on requirement and characteristics of data, the synchronization process can be categorized in two ways

  1. Unidirectional synchronization: replacing destination entity with the source entity
    In a unidirectional synchronization, all of the contents from source entity will be placed to destination entity, which also implies, any content in the destination entity, that doesn’t exist in source entity, will be deleted.
  2. Bidirectional synchronization: merging data from both participating entities

Before understanding both synchronization processes clearly, let’s consider three sample states of data entities:

a) Initial state: where both source and destination entity contains exact same number of records and column values.

sync

b) Data change state: the state where data get changed in both source and destination entity.

 

c) The synchronized state: where data has been synchronized among source and destination state.

In a unidirectional synchronization, all of the contents from source entity will be placed to destination entity, which also implies, any content in the destination entity, that doesn’t exist in source entity, will be deleted.

 

There is a high degree of data lost risk factors in unidirectional synchronization, as all of the data contents will be deleted in the destination entity, which don’t exist in source entity. In the above sample, #2 and #5 row item has been deleted due to data synchronization process. So, database administrators need to be cautious to confirm that if this data lose is expected.   
 
In bidirectional synchronization, all of the rows and column values in source and destination entity will be merged data from both participating entities.

 

Thus, on bidirectional synchronization, no data will be deleted neither in source or destination entity during the synchronization process. However the only data lose risk factors in bidirectional synchronization can be considered when same data row (identified by primary key) that has been modified in source entity, get replaced in the destination entity.
In the above sample, #1 row has been updated in destination entity, from ‘Ashraf’ to ‘Ashraful’. So, database administrators need to be cautious to confirm that if this data replacement is expected.
kick it on DotNetKicks.com

January 03

Few Words From A Fresh MVP

One of the famous quotes of Socrates that drives me all the time is: "Know Thyself". Around the world there are lots of things which might be in your interest on not. Knowing yourself doesn't only mean to find your choices, it also includes the facts, which don't belong to your choice as well as!

Knowing what I don't know

Well, so I need to know myself. As a technical guy, how do I know where I can be the best fit or where I can be comfortable to explore my ideas to create new but necessary things? One of our favorite poets, Rabindranath Thakur told "It's very natural to be ignorant about something. But it often happens that, we don't know what we don't know!". In this very dynamic era of technical world, it is very much true. Technology is changing very frequently, so as professionals, always we need to find out best fits among all of the changes. To knowing about "what I don't know" was my first step to go forward. Of course, community contents, such as forums, articles, blogs, newsgroups was a great resource for me in that case, by getting informed what the experts and professionals are thinking about the latest software releases and development practices. Going thru among those, I got the basic idea about what I don't really know!

Learning in-depth where I can be a best fit

After experimenting and picking my choices, the next phase starts! I need to learn those in more detail. One of my most favorite quote about IT professionals is "To fit with current tech trend, we need to know something about everything and we need to know everything about something!". In real tech world, the term "everything" can't be limited within a specific boundary. So it's better to consider the term, "everything" is "as much as possible".

Implementation

Now the third phase to explore as a good professional, appears. Use what you have learned in your projects/works. But apart from simply putting the learned things should not be the "only" concern for a developer. While implementing any external content that I just learned, I tried to keep my eyes open to examine it's affect in the production environment.

Turning to personal contribution over the contents

Either comparing with other alternative solutions or analyzing the solution with respect to other dependencies, I often got some new ideas, thoughts, techniques to modify the used solution for the current project or for the future project with different context. This process not only makes me intimate with the contents in more details, but also opens several doors to provide the best solution in appropriate context. Apart from my personal usage, these alternative or better solutions can also be a valuable resource to my community friends, along with providing them a way to think more about it!

The four phases, which I just mentioned are my usual way to expand my knowledge (and thus myself) in most comfortable scenario. Thanks God, technology is changing very frequently, and thus always I can discover myself in an infinite loop!

My MVP 2007 Award

Once upon a time, I was a freelance newspaper journalist. I first used PC when I was in the second semester in my Bachelor in Computer Science degree! As usually, I was a bit afraid, whether i will be able to fit in this "unknown" area. The continuous process to knowing me opened doors for me to find myself to be fitted here. Besides my reference books, my community friends were a great resource for me.

Passing previous 7 years was a great adventure for me! Getting matured with the community contents and tutorial stuffs, one day I found that, besides getting, I can put my contents to my community friends as well as. The most interesting thing I felt, that, besides getting contents from the community, there is a big "joy" to share own contents in return.

Microsoft awarded me first time as a MVP "Most Valuable Professional" in "Visual ASP.NET" category for 2007, with respect to my community contributions over the last year 2006. My MVP profile can be seen here.

Of course it was a big surprise for me to find myself in an expert community. Apart from other benefits, I feel the best thing, to get a broader scope to get in touch with the Tech gurus. Thanks to Microsoft to provide me a new path to go forward with more perfection!

 

Cheers!

Object Oriented Tagging : Adding Power to Web 2.0 Tags!

One of the basic consideration in web 2.0 concept is 'tagging' where any contents in the web can be associated with one or more tags, which can be shared among social community network. It lets others to find any content according to their chosen tag. Tag is nothing, but a way to categorize any web content. In real world, any visitor can quickly reach to a content thru it's associated tags, can thus get a basic idea about whether s/he will consider it to read/download etc. "Search" is older concept to help users to find any desired content, but "Tags" provides users to have an open track to find his own choice which has not been discovered yet!

I am really a tag lover. All of the Web 2.0 sites I am using, I am associating web contents with tags, which helps me to properly organize and structure those. Well, the real world is not bed of roses, so I started to get confused, as soon as my contents get larger. For example, http://del.icio.us is one of my very favorite site, which is a award winning web 2.0 site, dedicated for bookmarking urls. Using browser buttons of http://del.icio.us, I can quickly bookmark any web page that I was just visiting into my http://del.icio.us account, with the URL, title, comment, as well as associate appropriate tags, which I have been defined previously in my account settings. From the beginning it really helped me to keep track of my web studies. So life got easier, it's matter of few seconds for me to find any site of a specific category, that I have been visited and found useful.

The Real World

Unfortunately, I am really a nerd reader :P So with in few months, number of my bookmarks crossed couple of hundreds. It turns to a bit problem to me, to find any URL through tag/category, as some of tags already have over hundreds of urls. More over, there are few tags, with similar or nearer meaning (for example: software-development, .NET, C#), and while searching, I didn't get sure that, in which tag, I have been associated the content, that I am just searching for!

So I started to feel that, I need to organize my tags in more intelligent way, so that for a long term period, all of my contents can be grouped together and found in much quicker time.

In the coming days, tags are getting more important place over the web, so we need to have some good concept and convention while tagging! Well, the popularity of tags lies due to its simplicity, so it will be used by the web users in very quick but un-structured way in the maximum time. That's great tho, you are free to choose your tags, but for important contents, "Intelligent" tags will really save lots of our time and effort!

Intelligent? Huh! Tags will be intelligent?

Well, tags can't be intelligent, it's true, but the fact is it can be designed and considered in intelligent way!

Object Oriented Tagging

Object Oriented concept has achieved a great deal of popularity among software developers in previous 2 decades. According to this concept, all real world entities, regarding a given context (or software requirements) are classified into separate areas and utilize each other as needed. One of the basic principal of Object Oriented technology is "Inheritance", where new classes can be inherited from super or base classes, that includes properties of it's parent class. This design idea facilitates the management of software architecture and codes very effectively, specially for large scale software. 

When we have large number of contents (for example: URL, image etc), the associated tags can utilized in according to the concept of "Inheritance" to manage all contents properly. Here tags should be structured like the "Tree" data structure (root node, parent node, child node, siblings node etc)! For example, we have a base tag "Software Development", clicking on which will result all the contents related to software development. Now consider another tag, named ".NET", which is a sub tag or sub category of "Software Development" tag. Clicking on the tag ".NET" should list the result related to ".NET", which will include a sub portion of "Software Development" tag. Clicking on the tag "Software Development" will considers the contents all the sub tags of "Software Development", including ".NET" tag contents.

It would be great, if users can define the tree structure of the "Tag Inheritance" tree structure through the web application and thus create the life easy while putting the tags for a content, as well as searching contents through tags will work in much meaningful and faster way. If we have a built-in support for defining tag tree structure, it would take only one "Tag" defining a content in .NET, along with relating the content with "Software Development" tag category. Otherwise both tags "Software Development" and ".NET" needs to be considered with independent (and meaningless) relation among these two tags.

A Sample Structure

To understand the problem in deeper sense, lets go with more complicated example. Consider the following tag structure.

                    {Software Development}                                       {Microsoft}

 ________________|      |__________________________      ____________|          |_________

|                                                                       |     |                                           |     

{...}                                                                  {.NET}                                                    {...}

                                                                         |    |

                                   __________________________     ____________________

                                   |                                                                         |

                              {ASP.NET}                                                             {C#}

                                                                                   

In the given example, all ASP.NET and C# contents are in sub tag of .NET. But an ASP.NET content might not related to C#, can be VB.NET or other stuffs and vice versa. So they lies in the same layer. In this context, considering ".NET" tag, it includes all tags related to "ASP.NET" and "C#" tag, but "ASP.NET" tag contents don't include "C#" tag contents.

Also, .NET can be a sub category of "Software Development", as this is a software development framework. But "Software Development" tag might have other issues, which are not related to .NET. As well as, .NET can be a sub category of "Microsoft", as this is a development framework by Microsoft. But "Microsoft" tag might have other issues, which are not related to .NET. So considering the tag "Software Development" or "Microsoft" guarantees to get the content of ALL of their sub category contents (.NET, ASP.NET, C#) but not vice versa.

Solution

Besides the built-in support in web application, we can solve this issues by maintaining our own policy while define and implement our tags. After some brain storming, I found two ways, where this object oriented approach can be fitted!

1. Root level

While bookmarking, consider the lowest level, and DON'T consider the corresponding upper parents. For example, "ASP.NET". We will define the tree structure by creating a special bookmark for each parent node. In this case, in the web application, we need to have a support to merge the contents of tags, which can be used by any other users in later time though a labeled name for that merged list. For example: For the merged list of "Microsoft", we can define it as follows:

Microsoft = ".NET" + "ASP.NET" + "C#" + {unclassifield "Microsoft" list}

2. Node level

While bookmarking any contents, starting from the lowest level, all parents corresponding to that level should be marked.

For example: a content related to "ASP.NET" should be bookmarked as follows:

ASP.NET content = "ASP.NET" + ".NET" + "Microsoft" + "Software Development"

Technically this is the most easiest way, as we don't need any type of support in the web application. All we need, is just to have a flat set of tags, which relations will be maintained while tagging. The problem is, the user always needs to remind the hierarchy of tags. As this is relatively tough for the users to remind the hierarchy, this idea can be used only in special or important content, where we don't have any tree or merge support in the web application. 

kick it on DotNetKicks.com

ASP.NET 2.0 Deployment: Some Common Considerations

Regarding the previous ages of VS.NET 2005, web project deployment was pretty simple, but with limited options. For different types of projects, you may have different types of deployment requirements. For example, you may wish only to update the dll or contents for each component of the project separately, specially if the project is too big to take much time to upload the components  each time. For smaller projects, it would be great if we can upload only one file to reflect the new changes of a project.

In the age of VS.NET 2005, I found that there several options have been offered to developers, initially which may make the developers confused. Basically there are two basic issues which should be considered at the top level of deployment design. One is content based and the another one is assembly based. When publishing a web site, there are two options are in place in this issue, which are being discussed here respectively. 

1. Allow this precompiled site to be updatable

In ASP.NET deployment, we can put the aspx files in corresponding locations, just as a place holder, where the contents will be placed in the corresponding .compile file in the bin folder, which can be enabled by making this option false. In that case, the following issues should be reminded:

  • a. .compile file and the corresponding file should be placed for each update of a given aspx, master file. If there is only change is code-behind class (i.e. code), this file should be included too.
  • b. For code change in App_Code, no need to copy App_Code.compiled, just copy App_Code.dll ( so far I learned!).
  • c. For code change in Global.asax, no need to copy App_global.asax.compiled, just copy App_global.asax.dll ( so far I learned!).
  • d. For changes in CSS files of App_themes CSS should be copied manually. (I don't have tested image and skin files yet!).

Any way, if this option is true, the deployment still requires .compiled file, but not for the pages, but for App_Code folder, App_global.asax files, which will be used as a resource locator. So any changes to these contents doesn't require to upload this files for the maximum time. I am not sure when the updated version of these files should be deployed, but to deploy the updated version of these files is a recommended practice!

2. Use fixed naming and single page assemblies

For deploying assemblies of a ASP.NET 2.0 projects there are three ways to do:

a. Single page assembly:

In Visual Studio 2005, for a ASP.NET 2.0 web application, we can deploy separate assemblies for each pages of the site! This can be done by enabling the above option.

If the ' Allow this precompiled site to be updatable' is disabled, that means a corresponding .compile file should also be deployed with the assembly of each page. In this case, if there is any change  in the content (i.e. text etc) of the page, we need not to deploy the updated .compile file in the web, as all contents are placed in the dll, but as the resource locator or for the basic rule, Atlas one version of .compile file should be placed in the bin directory of the deployment site. Any way, no matter, whether the change has been done in content or code, the page dll MUST be deployed! For a change in content, if only .compiled is provided, there is no error, but change will not take effect!

b. Batch assembly:

For different type of contents and codes, different sets of assemblies will be generated, if we make the above option false. So any change in the code of a page, requires the corresponding set of assemblies to be deployed. For aspx pages, there are few assemblies will be generated, with ' App_Web' prefix. Since, we don't know, Exactly which ' App_Web..' assembly belongs the code for the updated page, we need to deploy all the assemblies prefixed ' App_Web' if there is any change of a page.

For batch assembly, each dll includes a encrypted key in it's name (for instance App_Web_pr_login.aspx.16ec59e1.dll), and for separate web publishing, there are separate keys for the same type of contents, thus separate file name for the newer version. One interesting thing about these assemblies is,  newer version of assemblies can reside in the same deployment directory with the previous set of versions, without any conflict, and the newer version will automatically take place during execution of the corresponding content!

Also, if the 'Allow this precompiled site to be updatable' is disabled, and no updated version of .compile file is provided for the change on content side of the page, only deployment of the assemblies will not reflect the change in content side, unlike "Single page assembly" deployment. For change in the content side, both assembly and .compiled file MUST be deployed.

c. Merged assembly:

All of the coding contents can be embeded to a single assembly, like VS 2003 age, using a VS add-in named 'aspnet_merge.exe' provided by Microsoft. Unfortunately, this tool is not provided by default and should be downloaded and installed separately.

 

kick it on DotNetKicks.com
December 01

The Small Ocean

Small things are not that much small in life. Small honesty, small patient, small devotion, small dream makes a person to be fitted with bigger canvas, with a greater strength, by building lots of blocks for the basic foundation of life.

Sometimes big accidents, incidents makes a person to be frustrated enough to ignore these small chuck of blocks of life, which could return him/her back to a greater success that s/he just missed!

 
Photo 1 of 31

Ashraful Alam

Occupation
Location
Interests
Mohammad Ashraful Alam is a Software Engineer, who is dedicated to Microsoft .NET based development. This Bangladeshi national is involved with project management and development of several US based software projects from his country. Already he has managed and developed several software projects, which are being used by several users of different countries, such as USA, Canada, Australia, and Bangladesh. While developing and managing a team, he contains and maintains a set of well defined engineering practices developed by him and other online developer community. Beside software development, he has also written several technical articles and research papers published by IEEE Computer Society and many other worlds recognized publishers. When not engaged with technical stuffs, he likes to pass time with his friends, and family members, listens music or watches TV.