Posts Chapter 4 - Analysis and Design
Post
Cancel

Chapter 4 - Analysis and Design

Chapter 4 : Analysis and Design

Analysis helps your system work in a real-world context.

  • Pay attention to the nouns in the usecase. Those are the classes you need to write and focus on in your system.
  • Class diagrams give you and easy way to show your system and its code constructs from 10000 feet view.
  • The attributes in a class diagram maps to a member variable.
  • Textual analsis helps your translate a usecase into code-level classes, attributes and operations.
  • nouns in usecases can be classes and verbs in usecases can be methods.
  • coding to an interface, rather than an implementation, makes your software easier to extend.
  • By coding to an interface your code will work with all of the interface’s subclasses, even ones that haven’t been created yet.

OO principles

Encapsulate what varies Code to an interface rather than to an implementation Each class in your app should have one reason to change

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.

Summary / Takeaways

  • Well designed software is easy to change and extend
  • Use basic OO principles like encapsulation and inheritance to make software more flexible.
  • If a design isn’t flexible, then change it, never settle on bad design, even if its your bad design it has to change.
  • Make sure your class is cohesive, each of your classes should focus on doing one thing really well.
  • Always strive for higher cohesion as you move through your software’s design life cycle.
This post is licensed under CC BY 4.0 by the author.
Recent Update
Trending Tags
Contents

Trending Tags