Sunday, January 17, 2010

Using Re-Use...

As discussed in last post re-using existing code/components is one of the key thing for better development. Every organization will have repository of reusable components but how do we ensure their re usability? From my recent observations things that can be reused are

1. Common functionality exposed as services
2. Validation and other similar utilities
3. Edit rules and other UI logic

One stage where we can identify reuse is during design phase. You can easily identify the reusable services/components at this stage, But you can identify reusable validation utilities and other reuse opportunities only if you undertake detailed/low level design. But how many times we perform low level design? In these cases onus of identifying the reuse lies with developers and development leads. But bigger challenge here how will these guys know that there is some thing that can be easily reused? As a simple example a developer who is required to do date validations will know that there is a Date validation utils already written by some one else? In general hectic schedules it is very much possible that we oversee reuse opportunities and end up coding again (reinvent wheel).
The thumb rule that I like to propose for developers is... while coding if you happen to code any thing that is not very close to Business of the application, then there is an opportunity for reuse. For example if you are coding a rule like - calculations based on some combinations of values selected on UI and some algorithm specific to application then there wont be much reuse opportunity. But if you are coding some Date validations, UI edit rules using Javascript (like restricting text field to accept only numbers) there is chance for reusing some thing existing. If you observe these are independent and had no close relationship with any business logic. In these kind of cases, you can search your organization's repository to find out suitable utilities.

I will continue discussing this topic with specific examples in further posts.

Recently I read some overview of Language called Scala which promises excellent support for component development. And it says Software development will become similar to assembling hardware. Means you will just need to put together some components and get the final product. This is an interesting thought and planning to spend some time on this.