Sunday, April 10, 2016

Java :OOPS Design Rules

OOPS Design Rules

Software :
  1. Perform what it supposed to.
  2. Flexible (by adding OOPS)
  3. Maintainable and Reusable

Object
  1. Object naming should be related to its operation
  2. Each object should not perform unrelated activities
  3. There should not be any unused properties or fields.
  4. Encapsulation helps divide application into logical parts.
  5. Duplicate code should be encapsulated separately
  6. Encapsulate what varies to protect class from unnecessary chages
Delegation: Delegating the current task to  specialized object which is designed to handle that.

Textual Analysis of Use Cases : Nouns = Classes and Verbs =methods.

Interface Vs Class
Coding to Interface is better as user has option to extend open.

Extra Classes make softare inflexible and difficult to change

No comments:

Post a Comment