Sunday, September 09, 2012

There is only one reality. That is Code. Everything Else is Illusion

There is only one reality. That is Code. Everything else (design and documentation etc.) is illusion.

Once I worked in a team, where the managers expected detailed design for everything. When, I say, we will have a single library for validation and data storage etc., they won't accept it. They expect the application to be modularized, and have many components. If somebody proposes multiple libraries, with each library doing one small work, they would be very happy about it.

I am very bad at presenting these things, and coming up with big architecture for very small problems. There was a person in my team, who is very good in these things. He came up with a design, in which, there are multiple libraries. One library for business logic and one for data storage etc.

There will be one business logic library, which does all the validations and processing of the data and the conversions from UI to DB and vice versa. The DB layer handles all the save and retrieval of data, and it is not burdened with any processing of the data or business logic. The entire business logic would be in the business logic library. In future, if the business logic grows, we can split into multiple libraries based on the functionality. Since, it is the first version, we can start with one library and see in the next release whether to split this library.

At the end, most of the methods in the business logic library are like this.
public BIObject GetBIObject(Parameters)
    return dbHandler.GetBIObject(Parameters)

public BIObject SaveBIObject(Parameters)
    return dbHandler.SaveBIObject(Parameters)
[For those who did not understand the above, the entire functionality (validation, storage and everything else) was developed in the data library. The business logic is just a wrapper with one line of code for each method.]

Everybody was happy by this method.

The managers were happy, because, the design is good, where there are multiple components, and it is modularized. The other developer was happy, because, the managers were impressed with his design. I was happy, because, the code was exactly the way, I wanted it to be. And, also, I was relieved from the burden of designing (which I never used anyway) and presenting it to the managers.

Related Links:
What does it take to convince a Manager?
Developing Libraries - Give Minimum Privileges

No comments:

Post a Comment