Wednesday, December 7, 2016

Object Oriented Analysis points to remember


Encapsulate what varies.

Code to an interface rather than to an implementation.

Each class in your application should have only one reason to change.


Coding to an interface, rather than to an implementation, makes your software easier to extend.



By Encapsulation what varies, you make your application more flexible, and easier to change.

When you have a set of properties that vary across your objects, use a collection, like a Map, to store those properties dynamically. 

You’ll remove lots of methods from your classes, and avoid having to change your code when new properties are added to your app.


Most good designs come from analysis of bad designs.



Never be afraid to make mistakes and then change things around.

Seeing how easy it is to change your software is one of the best ways to figure out if you really have well-designed software.

Cohesive class does one thing really well and does not try to do or be something else.


Cohesion measures the degree of connectivity among the elements of a single module, class, or object. 



The higher the cohesion of your software is, the more well-defined and related the responsibilities of each individual class in your application. Each class has a very specific set of closely related actions it performs.

Cohesion focuses on how you’ve constructed each individual class, object, and package of your software.

If each class does just a few things that are all grouped together, then it’s probably a highly cohesive piece of software. But if you have one class doing all sorts of things that aren’t that closely related, you’ve probably got low cohesion.


Use basic OO principles like encapsulations and inheritance to make your software more flexible.



Make Sure each of your classes is cohesive and should focus on doing ONE THING really well.

Always strive for higher cohesion as you move through your software’s design life cycle.

You solve big problems the same way you solve small problems.


Strive for a maintainable, reusable design.



By encapsulating what varies, you make your application more flexible, and easier to change.

Coding to an interface, rather than to an implementation, makes your software easier to extend.

Get features from the customer, and then figure out the requirements you need to implement those features.

Architecture is the organisational structure of a system, including its decomposition into parts, their connectivity, interaction mechanisms, and the guiding principles and decisions that you use in the design of a system.

Sometimes the best way to write great code is to hold off on writing code as long as you can and Plan,organise,architect,understand requirements,reduce risks all these make the job of actually writing your code very simple.


Absolutely! Remember,great software is more than just great code.



A design principle is a basic tool or technique that can be applied to designing or writing code to make that code more maintainable, flexible, or extensible.

First design principle is the OCP, or the Open-Closed principle. The OCP is all about allowing change, but doing it without requiring you to modify existing code.


Open-Closed Principle Classes should be open for extension, and closed for modification.