Login
BLOGs    August 1, 2010
Categories
 
 
 
Search
 
 
 
Archive
 
 
 
Latest Blog Entries
 
May12

Written by:Renato.Eccher
5/12/2009 9:10 PM 

The component architecture defines the responsibilities of each layer or component of an application. Defining this at the beginning of a project, implementing accordingly and validating it through code reviews is the basis for maintainable applications. By not defining it at the beginning, you will have as many component architectures as you have programmers on your team over time.

As the name ASP.NET MVC already suggests there are at least three components defined; namely the Model, View and the Controller. But lets first see what the main responsibilities of a regular data driven application are:

  • Data Representation: the model or actual data needs to be represented in a form the user-agent is able to consume. This information is sent in the HTPP request header by defining an 'accept' field. This field contains a semicolon-separated list of representation schemes and if missing the default value is 'Accept: text/plain; text/html'.
  • Look&Feel / Appearance: no-one likes to look at raw XML or HTML and so we send back stylesheets in our response together with our Data Representation. The user-agent (for example a web browser) then transforms the raw data into a look&feel that our ui-designers came up with. 
  • User Experience: many successful web sites (Google Search) are complete with the HTML and CSS defined above and in fact every web site should be usable without any Javascript & Ajax technology applied. Think of JavaScript and Ajax as browser side technologies to add bells & whistle for an improved user experience.
  • Business Logic: This term is probably ranked in the top-ten of most misused and misunderstood terms in computer science. In my definition of Business Logic, I exclude any business requirements for the user interface. Business Logic is a backend term and has two categories: filters and validators. Business Logic filters are applied whenever a model is requested from the backend and most of the time contain rules about the requesting user. I.e. only Model instances a user is allowed to see are returned. The other category of Business Rules are the validators and are enforced before Models are persisted back to the data source. For example, a Model has to be in a certain state in order to accept values or Model attribute values have to conform to specified rules.
  • Persistence: Models are objects in memory and since object-oriented databases didn't make to mainstream (yet), one layer of an application is concerned with mapping objects state to relational tables in a database and vice versa.
     

 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
 
 
 Copyright 2009-10 by EccoDynamics  Terms Of Use Privacy Statement