Friday, March 17, 2006

Domain Atom!

I was recently introduced to domain driven design. It means - "Ur design should be made up of building blocks that are existing as it is in Domain of interest and u should finally be able to explain the design to the domain expert/Req. Engg( must hav no tech slang) "

Check out http://domaindrivendesign.org/index.html

This is so different and this has totally changed my perception. till now the major problem was language of communication between the developers and the domain experts. now that agreed upon glossary is available, the language is common to both the developers and the domain experts. The developers' design only uses the agreed upon glossary and one of the design verification check is
- is it understandable by domain experts who have no technical knowledge?

This led me to compare the software developement with Physical world.

Consider the following scenario...

Any domain can be broken down into indivisible part. i.e. a smallest unit beyond which it loses its purpose.. for example, Customer in a banking domain.. it is a basic unit that defines a person/entity that can be subjected to various work flows in the banking domain.

We can consider such units as DomainAtoms. DomainAtom is an indivisible part of the domain and has some meaning that completes the domain definition.Another example of Domain atom would be a SavingsAccount.. we can quote lotsa such examples.
When we want certain logic to be implemented using these DomainAtoms then we get something called DomainMolecule. DomainMolecule would be made up of two or more different DomainAtoms. This DomainMolecule will internally use individual atoms properties but for outside world would expose totally new set of functionality also. this leads to similar such comparisons with physical world..

Collection of DomainAtoms/DomainMolecules -- DomainPolymer

DomainAtom/DomainMolecule that needs to broadcast message(event) all around -- DomainRadioactive Isotope ;-)

sometimes there may be partial implementation that need to be completed in later stage (more like Ions) which can be done using Partial classes!!
further, there are these properties and fields which are like matter paricles and events,methods which are like force particles..
and C (velocity of light) equivalent would be machine cycles for an instruction..

and strangely, both Class and Carbon have "C" as first letter.

Further, as atoms and molecules are bound by rules of physical world, the DomainElements will also be governed by these rules. these rules can be inherited or contained rules which are generic and have global definition..

Further, these DomainElements should be directly be consumable, i.e. they should be ready to be used in whatever form of UI or logic that might require it.. conversely such knowledge can be created else where and contained within these elements.. Even though ,the atoms are bit complex, they are very much user friendly...

this then leads to another possiblity.. havin got intelligent atoms and molecules .. we can program any new logic that needs these by just combining them into a new molecule or polymer!! may a RAD UI can be created(like VB) which will generate code for this..

i donno somebody would surely have tried this out.. but the computers can understand only finite set of rules and logic.. it just asks us to build our logic outta them ... so y not hav one more level of abstraction...