Sunday, November 9, 2008

Application Architecture

Last days I was busy in discussion architecture of an Application.
Without going in any further detail we divided our application architecture (Arch) into traditional three layers. But throughout the whole design of application Arch that implementation should be separate from the communication between layers.
I explain what I did with it.

User Interface
First of all discuss UI actually it depends on the technology you are using like I was on .net then .net provides you controller class in shape of aspx.cs ,but it would be different in case of Java.
In Java usually most of architects use Front Controller Pattern but in case of .net we usually prefer Page Controller Pattern I will not delve into the detail of patterns because this is not our target.
I really love this pattern(FCP) to use in my application .In Asp.net we have facilitated by web Framework of .net it handles itself all the requests,but if needed more control on application or new request handler so go to FCP.

Page control pattern should be use in every application it reduce our calling from every instance, it take care of all prevention that we have to do on every page.

Like session, security, some cached object, most visited objects and all decision we have to take on most of the pages we promoted it into base controller. Base controller will handle it, now it’s time to move on Facade thin layer.

Facade
As our focus on we want to separate implementation from its abstraction. Actually this is very important for us to know this rule. Everyone can implement own its own way. I do it on my own way , Everyone do it according to his business needs and its convenience. But rule should be same.We use FAÇADE because of facade can call BAL or might be outside of our domain like web service etc.
So, UI layer shouldn’t be affected and free from this knowledge that where it gets data and what is the complexity or calling cost.

BAL (Business Access Layer)


Business Manager contains all the business knowledge of Application, Transactions ensures, maintain abstraction between UI and DAL. Architecture should have BaseManager which responsibility is control transaction, most frequently called methods actually this is contract between Façade and BAL so, FACADE doesn’t know about the implementation of Managers. There is a question manager can’t have same methods then we have to make interface for each manager just for separating it from implementation because you can have two managers for same purpose for any need/requirment, it provides you a flexibility to change your implementation according to your need and your application other part will work smothly.
In every BAL class should be singleton just for ensuring a single object and avoiding unnecessary object on every call.

Another good Idea about it is I read something about spring framework this is excellent it takes all the responsibility of making object we just pass the object name and it creates it for us. Great thing of this framework is you can also define dependency and it will create object for you with all of its dependencies.
Great work!

Data Access Layer

Data Access Layer also the same rule we define interface for every DAO. Every DAO object should be singleton because otherwise might be there is a huge amount of unnecessary object creation.
For avoiding this extra object creation implement singleton in every DAO

This is BaseDao responsibility to control the internal transaction and all search criteria, Creation, Deletion and Updating method to avoid redundancy of same implementation. It can be possible to have object caching because it will avoid your round trip of server each time and improve the performance of your application. Most important thing to use this framework is work with objects rather xmlDataset. For Object Relational Mapping you can use

• Nhibernate
• ORM Tool
• Opf3
• Entity Framework

For avoid creation of Dao object every time in BAL you can use As I discussed earlier some Framework following Inversion of control prevent us to couple other layer and take responsiblity of object creation. I am discussing here Spring Framework we have also other Framework available you can use according to your requirement and ease of use.
So, this framework responsibility to create, session and keep all its dependencies and return on calling correctly.

Sunday, November 2, 2008

cutomize workflow

I have updated my previous workflow blog with detail example see
http://nazishalirizvi.blogspot.com/2008/09/customize-workflow.html

Sunday, September 14, 2008

Customize Workflow

What is workflow?

The workflow process is traditionally defined in office terms—moving

the paper, processing the order, issuing the invoice. But the same

principles and tools apply to filling the order from the warehouse,

assembling documents, parts, tools, and people to repair a complex

system, or manufacturing the complex device.

In software world we encounter workflow when we have to atomize process, approval mechanism,

document routing, process sequence, execution sequence and many more…..

With the automated workflow management system:

· Work doesn’t get misplaced or stalled—expediters are rarely required to recover from errors or mismanagement of the work.

· The managers can focus on staff and business issues, such as individual performance, optimal procedures, and special cases, rather than the routine assignment of tasks. The army of clerks is no longer required to deliver and track the work.

· The procedures are formally documented and followed exactly, ensuring that the work is performed in the way planned by management, meeting all business and regulatory requirements.

· The best person (or machine) is assigned to do each case, and the most important cases are assigned first. Users don’t waste time choosing which item to work on, perhaps procrastinating on important but difficult cases.

· Parallel processing, where two or more tasks are performed concurrently, is far more practical than in a traditional, manual workflow.

How I implement workflow?

I have the same problem like I have to atomize the entity levels according to their status , presenting sequence on User Interface and can be attached any entity at any level. Their history is flow is also a problem. Currently I am working in financial domain before that I have encountered this same problem in my news management application. Like after news arrival I have to maintain its flow according to its current status where it will be present and to whom. Its history like who change status what changes he made and when he did this. I have to take care of it like at first stage someone can attach other entity also like documents, any media etc. So, I have to maintain at any stage document attachment, media attached history.

· Default Workflow

· State wise entity attachment

· Maintain the history record of each entity like its current state and its previous state.

· Implement Horizontal workflow

· Implement Vertical Workflow

Before explaining the above three points. I want to explain the workflow then we can discuss the workflow states and it will be easy to digest. Because without explaining workflow, workflow states will be meaningless. Workflow system starts from workflow entity, any other entity will be attached with workflow and with any specific workflow states will be attached. Workflow states further associate with state changes and its history.

Logical View of Workflow system



WorkFlow

Default Workflow

After creating a workflow end-user can make default workflow to free from every time assigning the same workflow for any module. For instance for any module user can assign a workflow instead of assigning it every time. It saves time and effort automatically module will be attached with its defined workflow.

State wise entity attachment

It obvious that if an entity is in initial level some documents and other actions stuff can be attached which can be vary depending on its state. So keep track of every state attachment is very necessary.

It also help to retrieve its previous state.

State Change





Maintain the history record of each entity like its current state and its previous state

It’s very necessary to maintain the record of any entity of its life cycle journey .Easily traceable like who change its state, what documents attached with it, When user want to revert the record than it can easily find its all states.

State Change History

Implement Horizontal workflow

One function of a workflow system is to get the work to the right person or process—to move the work through the organization. This is sometimes called “horizontal” workflow. In my news management system news is flow in horizontal direction. Every responsible put their action and forward it to other responsible for their action.

Horizontal Workflow

Implement Vertical Workflow

Normally a case consists of multiple tasks—programs, portions of programs, or manual steps performed at each step in the workflow. Therefore another possible workflow function is to see that all the tasks are completed the “vertical/parallel” workflow. In my system when any breaking news come and directly approve by the news director. News management system service closely monitors the status of news and generates an email and sms to responsible person.


P.S For further assistance you can mail me on rizvinazish@gmail/yahoo.com

Monday, September 1, 2008

I got 100/100

Hi,
I was busy in my Microsoft share point service configuration exam as I told you before.
Alhamdulilah I have cleared my exam with colors.I got 100 out of 100 means I got 1000 point
where required points was 700.
I am very happy ......................

Wednesday, July 16, 2008

Custom WorkFlow System

I will post this blog with clear and detail example.

Monday, July 7, 2008

Share Point Configuration Exam

Hi,
Now a days I m preparing for Share Point Configuration Exam.I got "Sams Microsoft SharePoint 2007 Unleashed" this book is very informative.you can get this book from www.flazx.com. not only this book a lot of books available here .Any how I will update my blog as I got my certification,or I found something helpful for this exam.

Friday, June 13, 2008

Nhibernate with tirggers

I was working on Nhibernate Framework, I found a feature in this framework that I want to explain you.
I have to make a transaction between two tables they have parent and child relation on child creation or updating a trigger is fired take sum of child rows and update into parent.
Everything doing fine with transaction no exception but no updating in parent record after hitting trigger.That’s amazing for me .Long story short actually Nhibernate having a state of parent with previous values again updated on commit of transaction.So, I have to create a separate transaction for parent and child also. And don’t forget to Call NHibernateSession.Flush();after commit a transaction. Like
BaseDao.NHibernateSession.Transaction.Commit();
NHibernateSession.Flush();

But it’s very critical in the situation when you have to ensure that every thing should be in one go(transaciton) then realy it’s a question.I had faced this problem in the same project,but fourtunately I have a columns which shows record is deleted in first transaction I pass this true isdeleted=true and after commiting and flushing .Begin another transaction the then pass isdeleted=false.Because my trigger only works on isdeleted=false record.Anyhow its just a one solution which works in my scenario.if any one has some good idea please share with us.

Friday, June 6, 2008

Feature Framework Code

Recursively I have to drill down all the control, one thing off course every table row, td should be tagged as runat=”server” and with proper Ids.

foreach (Control pageChildControl in Page.Controls)
{
if (pageChildControl is HtmlForm)
{
HtmlForm frmControl = (HtmlForm) pageChildControl;
frmControl.Attributes.Add(m_LinkedId, m_PageFeatureId.ToString());
formControl = pageChildControl;
break;
}
}

if (formControlCollection != null)
{
foreach (Control formChildControl in formControlCollection.Controls)
{
if (formChildControl is AsynchPanel)
{
AsynchPanel lbPanel = (AsynchPanel) formChildControl;
string parentId = ExtractControlLinkedId(lbPanel.Parent);
lbPanel.Attributes.Add(m_LinkedId, parentId);

ExtractHtmlTableControl(formChildControl);
}
else if (formChildControl is HtmlTable)
{
if (CheckFeatureExistanceInParent(formChildControl, string.Empty))
{
if (!formChildControl.Visible)
{
continue;
}
ExtractHtmlRowsFromTableControl(formChildControl);
}
}
}
I have also attached code with it which I have written .Still I am working on it due to urgent task and off course following timeline I have postponed this for some time.

Wednesday, June 4, 2008

Feature FrameWrok

Last week I worked on some sort of parser for my own security in the application. My application domain is financial application is for Private Equity Funds and its distributions.
Actually our requirement is we want to assign rights on each and every item in the application. Some of them I am sharing with you .like.
Restriction on field level like one user can’t see this field but can see others. For example an ordinary user can’t see the head’s phone numbers, although he can see all other information.
Similarly on changing of any fund user logged in user should have rights to see the incoming data. Restriction level is up to the gird’s columns level .Logged in user can see this columns only depends on his rights.
And I will write about when I start working on the security of methods either Logged in User can call this method or not. I am thinking about enterprise security library for this. Let see
For the every feature security we assume every item in my application either it’s control or any data it’s a feature. This is DataBase view of my feature FrameWork.
imgframework.jpg

Saturday, May 24, 2008

What is Share Point?

What is Windows share point3.0?

WSP3.0 is consisting of these features.

· Storage

· Security

· Deployment

· Site Model

· Deployment

Storage

Windows share point server3.0 providing us best way of storing our contents (documents of any type, custom binary files, and web contents) with classification of their major and minor versions, metadata with full data management capabilities. All Data reside in MS SQL server.

Security

Security is everyone’s concern WSP3.0 providing a range of security providers. NTLM, Kerberos, Active Directory, Single Sign On Server (SSO), Asp.net Forms authentication and we can apply security permissions on entire sites and its individual items.

It’s very helpful to integrate these providers because without implementing a new security policy we can use existing security policy. Like we can allow those who are already had an account on Active Directory list and more or different security features with other providers.

Tuesday, May 13, 2008

user control casting of different directory

Today I face a very good problem­­ :) in asp.net user controls and I am sure most of our developers face this same problem when they havily use usercontrols in their projects.
I have two controls one has a dropdown on the change of this dropdown selection I have to notify other controls .Yes you are right I promptly go for observer pattern but in .net we have events a good replacement. So I expose this dropdown event as property.But problem is I have to know the this dropdown selected value on other events also like on grid selection.So its better to expose this dropdown selected Item as property.Above discussion have only technical complexity ,but problem you face is different.I have to cast this dropdown usercontrol in its own type but in other user control.
ui_usercontrols_common_namefinder_ascx ucCurrentnamefinder = (ui_usercontrols_common_namefinder_ascx)namefinder;
ucCurrent
namefinder.NameChange +=new EventHandler(OnNameChange);
You will get the error “you are referenceing unkown type or assembly”.so you have to specify a tag of Reference VirtualPath = "../Common/namefinder.ascx"
you have to use this tag in that control in which you want to access other controls like in my case is namefinder.ascx
Then you should also use asp as prefix of control for safe side as following.
ui_usercontrols_common_namefinder_ascx ucCurrentnamefinder = (ui_usercontrols_common_namefinder_ascx)namefinder;
ucCurrent
namefinder.NameChange +=new EventHandler(OnNameChange);