During
software development, have you ever got involved in the situation where your
client suggests change(s) one day prior to go live date, you analyze the change(s),
their impact and revert back to the client saying, “It will require a database
change, hence it will require a week (or so) to accommodate the change”?
Imagine what the client will think about you. He will think like, “What a bunch
of absolute cretins we have over there! I asked them to move a field from one page
to another and they are saying that they will require a week to do the job. Even my dog can do this in 3 hours.”
Well, at that time, we can’t do much apart from convincing them why we will need a week. But, what we can do to avoid such situations is to deign our system so strongly/flexibly so that we can accommodate any change without much impact. This is what this blog post is all about. We will discuss the importance of design phase during software development life cycle. And yes, unlike the previous blogs(which were implementation based), this blog is an approach based blog.
From all the constituents of software development life cycle, design phase is the most important one. An ideal design phase should take around 60% time of an SDLC. More sound the design of your system, more flexible/maintainable your system would be. What developers generally do during design phase is, well, nothing. They will fill a document or two as per company’s process and that’s it. They won’t even look at those documents during coding/implementation phase. And, at the time of implementation, they will decide the name of the table, which columns would be there and all that. This is pathetic way of implementing the system.
Let’s discuss how we can design the system properly. We will discuss the different phases/parts of design phase which are important.
Database Design:
This is the most important and critical part of design phase. The whole future of your system depends on this. People do Ph. D’s on database design. Let’s discuss what aspects we need to consider while designing the database.
Before designing any table, one must have a mindset that the client is going to populate gazillions of records into the table. At that time, your system should be able to perform all DML operations including joins without any hitch. Normalization and number of tables are also important aspects. If you are designing any transactional system (OLTP) then the normal form and number of table can be as high. But if you are designing any analytical system (OLAP) then number of tables and normal form can be lower. Type of columns as well as number and type of indexes are also important while designing a database.
The outcome of design phase should be the database design document along with the table creation scripts. Also, there should be DML queries which will be required during development so that developers can straight away integrate those queries into their class.
Low Level Design/Detailed design:
Once database design is completed, we can go ahead with low level design. This phase consists of many sub phases. We will discuss each sub phase one by one.
Class Diagrams:
Once we have table structures ready, we can easily identify which classes need to be created i.e. bean/DTOs, service/business layer classes, database layer classes etc. We can also identify which methods will be required in these classes. Hence, we can create class diagrams of all the classes. A sample class diagram is shown here. It consists of attributes and methods of a class and also, relationships among the classes. The use of class diagrams is to guide the developer during the implementation. Ideally, we should go ahead and implement those classes. That will make developer’s task easy.
Class Details:
A class diagram should be followed by the table containing the information about the classes and their methods i.e. which method performs which action, what is the significance of each argument of the method etc, hence, making the implementation of the method a cakewalk.
Sequence Diagram:
A sequence diagram indicates a round trip from sending the request to one page to receiving the response on same/other page. It will contain all the layers of the system. The use of sequence diagrams is to make sure that the control follows the architecture i.e. from jsp page; the request should not go directly to database interaction layer. A sample sequence diagram is shown here.
Algorithms:
Once we are done with the structures of classes and all, we should focus on inner crux of them. This phase is most important sub phase of low level design. The algorithm contains the steps of how a particular workflow should take place inside the method. If a workflow contains the involvement of more than one method/existing method(s) then the corresponding class name and method name should also be present against the respective step. The algorithm will make the task of developer a lot easier. It will serve as a guide of how to implement a particular use case.
Test Plans:
Testing is also one of the important aspects of software development. If the system is not tested properly, then, all the good work of development may go out of window. To test the system thoroughly, proper documentation of test plans is required. There can be many types of test plans i.e. unit test plan, integration test plan, system test plan. If you have a separate QA team for testing then they can also assist you in the creation of test plans. In fact, apart from unit test plan, it is their responsibility to create the test plans. Test plans are used to check the quality of the system.
Traceability Matrix:
Final artifact of the design phase, and also the blog, is the traceability matrix. It provides the traceability of a requirement/use case to its relevant documents. IT contains the table structure like the one shown below:
It will map each use case with the corresponding document names, hence, making it easier to trace the whole use case. If more than one instance of the document exists for a particular use case then, all names will be present in the corresponding cell.
Well, at that time, we can’t do much apart from convincing them why we will need a week. But, what we can do to avoid such situations is to deign our system so strongly/flexibly so that we can accommodate any change without much impact. This is what this blog post is all about. We will discuss the importance of design phase during software development life cycle. And yes, unlike the previous blogs(which were implementation based), this blog is an approach based blog.
From all the constituents of software development life cycle, design phase is the most important one. An ideal design phase should take around 60% time of an SDLC. More sound the design of your system, more flexible/maintainable your system would be. What developers generally do during design phase is, well, nothing. They will fill a document or two as per company’s process and that’s it. They won’t even look at those documents during coding/implementation phase. And, at the time of implementation, they will decide the name of the table, which columns would be there and all that. This is pathetic way of implementing the system.
Let’s discuss how we can design the system properly. We will discuss the different phases/parts of design phase which are important.
Database Design:
This is the most important and critical part of design phase. The whole future of your system depends on this. People do Ph. D’s on database design. Let’s discuss what aspects we need to consider while designing the database.
Before designing any table, one must have a mindset that the client is going to populate gazillions of records into the table. At that time, your system should be able to perform all DML operations including joins without any hitch. Normalization and number of tables are also important aspects. If you are designing any transactional system (OLTP) then the normal form and number of table can be as high. But if you are designing any analytical system (OLAP) then number of tables and normal form can be lower. Type of columns as well as number and type of indexes are also important while designing a database.
The outcome of design phase should be the database design document along with the table creation scripts. Also, there should be DML queries which will be required during development so that developers can straight away integrate those queries into their class.
Low Level Design/Detailed design:
Once database design is completed, we can go ahead with low level design. This phase consists of many sub phases. We will discuss each sub phase one by one.
Class Diagrams:
Once we have table structures ready, we can easily identify which classes need to be created i.e. bean/DTOs, service/business layer classes, database layer classes etc. We can also identify which methods will be required in these classes. Hence, we can create class diagrams of all the classes. A sample class diagram is shown here. It consists of attributes and methods of a class and also, relationships among the classes. The use of class diagrams is to guide the developer during the implementation. Ideally, we should go ahead and implement those classes. That will make developer’s task easy.
Class Details:
A class diagram should be followed by the table containing the information about the classes and their methods i.e. which method performs which action, what is the significance of each argument of the method etc, hence, making the implementation of the method a cakewalk.
Sequence Diagram:
A sequence diagram indicates a round trip from sending the request to one page to receiving the response on same/other page. It will contain all the layers of the system. The use of sequence diagrams is to make sure that the control follows the architecture i.e. from jsp page; the request should not go directly to database interaction layer. A sample sequence diagram is shown here.
Algorithms:
Once we are done with the structures of classes and all, we should focus on inner crux of them. This phase is most important sub phase of low level design. The algorithm contains the steps of how a particular workflow should take place inside the method. If a workflow contains the involvement of more than one method/existing method(s) then the corresponding class name and method name should also be present against the respective step. The algorithm will make the task of developer a lot easier. It will serve as a guide of how to implement a particular use case.
Test Plans:
Testing is also one of the important aspects of software development. If the system is not tested properly, then, all the good work of development may go out of window. To test the system thoroughly, proper documentation of test plans is required. There can be many types of test plans i.e. unit test plan, integration test plan, system test plan. If you have a separate QA team for testing then they can also assist you in the creation of test plans. In fact, apart from unit test plan, it is their responsibility to create the test plans. Test plans are used to check the quality of the system.
Traceability Matrix:
Final artifact of the design phase, and also the blog, is the traceability matrix. It provides the traceability of a requirement/use case to its relevant documents. IT contains the table structure like the one shown below:
Use Case #
|
Use Case name
|
Requirement document
|
Prototype
|
Test Plans
|
JSP
|
Properties
|
Java
|
It will map each use case with the corresponding document names, hence, making it easier to trace the whole use case. If more than one instance of the document exists for a particular use case then, all names will be present in the corresponding cell.
Voila!
We are done with the discussion of design phase. Please note that we have only
discussed the important phases of design here. There are many other phases as
well (like High Level Design, etc). We have discussed only those phases which
are important.
Consider
the scenario of first paragraph once again; you have designed the system properly.
One day before go live date, the client asks to move the field from one page to
other and also, asks for the estimates. In this case, your proud answer will
be, “We will be able to deliver the change in next 2 hours!” At least, now we are faster than his dog!
~ Ciao