Programming with Attributes
page 1 of 4
Published: 27 Sep 2003
Unedited - Community Contributed
Abstract
Every software developer at one time or the other would have felt "How I wish I was a hardware engineer?" . If we had the luxury of having a "software circuit" like the hardware circuit, where a small part can be replaced very easily it would have been a path to software success in totality today. To achieve a level of success in "software circuitry" we have been programming using varied programming techniques and have come a long way from structured approach to object oriented approach. Attribute Based Programming would help developers to "build software circuits".
by Kavitha Pradeep
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 22646/ 98

What is Attribute Based Programming?

Before the advent of object oriented programming, the design of the system was done by breaking the system into modules and then integrating the entire functionality by making calls to the functions. The concept of reusability was bleak.

Then software development ventured into object oriented programming, where reusability and scalability were targeted. Normally, a design of any application is thought in terms of componentizing the entire application for further reuse. In a distributed web application the UI tier, the business tier and the data tier is what comes to our mind. But the paradigm shift to object oriented programming or component based development was not helpful to a very good extent as objects were glued to code. In a method  “ Save “ of a class File the code written would be , instantiating a sequence of objects for establishing a connection , execute a command , log the transaction , close connection . These sequences of object creation would have to be written in all the methods where data is going to be saved. A developer is thus doing some kind of re-writing of code. In C++ the constants, attributes and operations were annotated with public, private or protected. This annotation is interpreted by the C++ compiler to add special meaning for each annotation there by giving access and security to data. Attribute based programming helps to annotate classes, constructors, properties, methods to add more meaning to them during runtime. The attributes can be added or removed from the code conveniently and the duplication of code across methods is eliminated. The runtime uses these attributes to compose an object stack when the object is created. When the client makes method call each attribute gets a chance to execute its part and transfer control until finally the actual method is invoked. During the stack wind up each attribute is again given a chance to wind up and the final stack wind up takes place. This means that the sequence of operations that you wrote is now handled by the runtime. Usage of attributes gives flexibility to code and avoids duplication of code. Lets us look into the recipe of .NET to design attributes, write custom attributes and use pre-defined attributes.


View Entire Article

User Comments

Title: very very nice article   
Name: kasi
Date: 2012-03-17 5:48:04 AM
Comment:
thanks you very very very much Kavitha Pradeep..a nice article

i hope please write one more on attribute based programming

i am waiting
Title: good Example for Attributes   
Name: Sivakumar
Date: 2007-09-05 2:49:09 AM
Comment:
good Example for Attributes
Title: so cool   
Name: prince
Date: 2006-02-13 7:45:48 AM
Comment:
thanks a lot, this website is very useful for me
Title: Good Site   
Name: Anju
Date: 2006-02-10 7:47:42 AM
Comment:
I found it very useful.
Title: comments   
Name: sanjeev
Date: 2005-12-29 5:25:10 AM
Comment:
very good site
Title: great   
Name: devil
Date: 2005-01-18 4:36:48 AM
Comment:
good artical ...as i was searching for this [STAThread]...anyway nice work...want ur help if u r interested as i am a novice programmer into the world of .net...






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-10 3:55:11 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search