January 10, 2011

Review your Architecture

Last week I bumped in to a book "Enterprise Application Arch 2ed". I read abot reviewing S/W arch by some proven methodlogies..thot would blog for starters.. good read...

Scenario-based evaluations are a powerful method for reviewing an architecture design. In a scenario-based evaluation, the focus is on the scenarios that are most important from the business perspective, and which have the greatest impact on the architecture. Consider using one of the following common review methodologies:

Software Architecture Analysis Method (SAAM). SAAM was originally designed for assessing modifiability, but later was extended for reviewing architecture with respect to quality attributes such as modifiability, portability, extensibility, integratability, and functional coverage.

Architecture Tradeoff Analysis Method (ATAM). ATAM is a refined and improved version of SAAM that helps you review architectural decisions with respect to the quality attributes requirements, and how well they satisfy particular quality goals.

Active Design Review (ADR). ADR is best suited for incomplete or in-progress architectures. The main difference is that the review is more focused on a set of issues or individual sections of the architecture at a time, rather than performing a general review.

Active Reviews of Intermediate Designs (ARID). ARID combines the ADR aspect of reviewing in-progress architecture with a focus on a set of issues, and the ATAM and SAAM approach of scenario-based review focused on quality attributes.

Cost Benefit Analysis Method (CBAM). This CBAM focuses on analyzing the costs, benefits, and schedule implications of architectural decisions.

Architecture Level Modifiability Analysis (ALMA). ALMA evaluates the modifiability of architecture for business information systems (BIS).

Family Architecture Assessment Method (FAAM). FAAM evaluates information system family architectures for interoperability and extensibility.

Refer this URL
http://enggtech.wordpress.com/2010/05/13/software-architecture-qaw-add-atam-cbam-arid-and-sdlc/

February 20, 2010

Iterating over JSON object (string ) with jquery

We had a scenario where in we need to search for particular object in collection. Whenever the user changes something in dropdown in ASP.NET we need to show some value in a label. If we take the drop down value to server it would take time.... so what we thot is we searialized the object using JavascriptSerializer in ASP.NET and converted to JSON string.. passsed to a javascript function to search.... (whenever dropdown changes)... I was literally amazed with the power of JSON and jquery combination... thot i would share with people in need.....

Here is the JSON string...in Javascript...

var obj = [{"Description":"No jquery pricing group may be used for Testing", "ID":1, "TempID":1, "CompareID":3}, {"Description":"No jquery pricing group may be used for Testing", "ID":2, "TempID":2, "CompareID":3}, {"Description":"No jquery pricing group may be used for Testing", "ID":3, "TempID":3, "CompareID":3}, {"Description":"No jquery pricing group may be used for Testing", "ID":4, "TempID":4, "CompareID":3}, {"Description":"No jquery pricing group may be used for Testing", "ID":5, "TempID":1, "CompareID":4}, {"Description":"Jquery required for pricing Testing", "ID":6, "TempID":2, "CompareID":4}, {"Description":"Jquery required for pricing Testing", "ID":7, "TempID":3, "CompareID":4}, {"Description":"Jquery required for pricing Testing", "ID":8, "TempID":4, "CompareID":4}, {"Description":"No jquery pricing group may be used for Testing", "ID":9, "TempID":1, "CompareID":5}, {"Description":"Jquery required for pricing Testing", "ID":10, "TempID":2, "CompareID":5}, {"Description":"Jquery required for pricing Testing", "ID":11, "TempID":3, "CompareID":5}, {"Description":"Jquery required for pricing Testing", "ID":12, "TempID":4, "CompareID":5}];

We had a requirement to searhch the description for matching TempID and COmpareID...

Our Javascript function was amazingly...

function Myfunc(ID1,Exp1){jQuery.each(obj, function Test(x) { if (obj[x].TempID == ID1 && obj[x].CompareID == Exp1) //return obj[x].Description; alert(obj[x].Description);}); }

This would have helped you to understand the power of jqeury

January 16, 2010

ASP.NET Dynamic User controls

Today after long time...I moved to an assignment to work in ASP.NET after the gap of almost nealry 5 years. I started working on an Intranet Portal for a financial institution.

We wanted to generate certain UIs dynamically, we chose different user controls will be loaded based on the user requirement. One thing I learned today is "Dynamic Controls Should be Loaded on Each PostBack" On every postback literally you need to load the controls again and again. If you want the control to have its Viewstate data preserved, adding the USercontrols to page (Parent) should happen before LoadViewstate event gets fired in the page life cycle.

Normally the user controls will be added as Controls.Add(UsercontrolPath), where ocntrols is Place holder in the page/another user control.

I will write more about this assignement that looks very interesting.

January 5, 2009

Meta Data Queries in SQL Server 2000

-- Query to Find All User Tables

SELECT * FROM SYSOBJECTS SOWHERE SO.XTYPE = 'U' ORDER BY SO.NAME

-- Query to Find All User Views

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'V' ORDER BY SO.NAME

--Query to Find all Procedures in the DB

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'P' ORDER BY SO.NAME

--Query to Find all Triggers in the DB

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'TR' ORDER BY SO.NAME

--Query to Find all User Defined Table Functions in the DB

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'TF' ORDER BY SO.NAME

--Query to Find all User Defined Inline Functions in the DB

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'IF' ORDER BY SO.NAME

--Query to Find all User Defined Scalar Functions in the DB

SELECT SO.NAME FROM SYSOBJECTS SOWHERE SO.XTYPE = 'FN' ORDER BY SO.NAME

Note.
X.Type define the object type, the possible values are
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
FN = Scalar function
IF = Inlined table-function
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedure

December 2, 2008

SSIS - Script Component - Variables Access Error

I was developing an SSIS package and I encountered the following problem.
I had a OLE DB source that is providing me data from a SQL table in my data flow task. I had a script component following it. I am trying to concanctenate my one of the string column to a variable and trying to use it in other task.
So I had my code like this in my inputprocessrow method.
--------------------------------------------------------------------------------------
While Row.NextRow
myval = myval + " , " + Row.customer
End While
----------------------------------------------------------------------------------------
And i was trying to set the local variable value to my Pacakge variable collection and I encountered following error.
"The collection of variables locked for read and write access is not available outside of Post Execute", which drove me mad.

After googling for some time got this info.

You need to have a PostExecute method and try assigning it there.

-------------------------------------------------------------------------------------
Public Overrides Sub PostExecute()
Variables.Customers = myval
MsgBox("Variable Values is " + Variables.Customers)
MyBase.PostExecute()
End Sub
-------------------------------------------------------------------------

July 10, 2008

SQL Injection Tip

Hope everyone is aware of SQL Injection attacks. For people who are new, it is something about intruding in to your SQL Server (DB) by passing some commands through a request.

If the following (0x73656C656374206E616D652066726F6D207379732E6461746162617365733B) value is passed to the SQL Query, it will list all the DBs on the server. Something interesting. So whenever you get a request, check for it.