Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Answers


Reason , Application designs should be reusable, extensible and maintainable, should prevent subtle issues, avoid technical risks with proven solution and Design Patterns could be very helpful and only recommended solution in that.

What is meant by design pattern?

From Wikipedia

In software engineering, a software design pattern is a general, reusable solution to a commonly Occurring problem within a given context in software design.

Advantages

Following are some benefits using deign patterns ,

  • Proven, used and tested solution with no risks.
  • Design patterns prevents subtle issues. 
  • Provide reusable, extensible and maintainable design solution.
  • Readable and proper documented solution.
  • They have a proven track record as they are already widely used and thus reduce the technical risk to the project
  • They are highly flexible and can be used in practically any type of application or domain

Disadvantages

The only issue I have come across with Design Patterns is that they take time to learn, reason some are complex to understand and require skilled developers.

This may increase the project costs initially but for large and complex it will save your feature maintenance cost, easier extensibility.

Real world problem application design problem?

Application:

Logging framework

The problem:

The Logger Framework may be used by many different clients, with different requirements (i.e log in text files, log in xml files , display logs).

In this way, the client objects will repeat the same logic again and again and there is huge redundant code in your application. 

Design pattern solution (Factory method)

Use factory design pattern and keep all the logic of log creation and instantiation of the objects away from the clients. In this way, the client objects will not have to repeat the same logic again and again and it will be totally isolated from the future changes (like extension of Logger Framework by adding XmlLogger).

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.