Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Design & Analysis

Similar presentations


Presentation on theme: "Object Oriented Design & Analysis"— Presentation transcript:

1 Object Oriented Design & Analysis

2 Agenda SOLID Principles. Static VS OOP ?
What is Design? Why “Patterns” for design? Why Objects? OOP Concepts. Abstraction Encapsulation Inheritance (is-a relationship) Polymorphism Composition, Aggregation (has-a relationship) Association (uses-a relationship) SOLID Principles. Single-responsiblity principle Open-closed principle Liskov’s substitution principle Interface segregation principle Dependency Inversion Principle Static VS OOP ?

3 What is Design and Analysis?
Not the code, but how to think and model Programming: Language, C#, code, visual studio, forms. (low level) Design: Concepts, goals, diagrams. (high level) Blueprints Programming

4 Why “Patterns” for design?
General repeatable solutions for common design problems After Using 2 Design Patterns No – Design Pattern 5000 9000 Lines of Code Still the same  Every Where Bugs Easy to follow and remember Horrible Code Readability Fast and easy slow Time to fix or add new feature

5 Better Design =

6 Why Object Oriented Design?
We are objects Data represent state or attributes Behavior are methods Human Eyes Hands Legs Walk Stop Eat Sit Car Body Wheels Move Shutdown Steer Left Steer Right Word Document Paper Text Print Word Count Summarize

7 OOP Principles: Abstraction
The development of classes, objects, types in terms of their interfaces and functionality, instead of their implementation details. An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of object. Class Class Class

8 OOP Principles: Encapsulation
Hide state, Reveal Behavior Car Body Wheels Engine Move Shutdown Steer Left Steer Right Start Engine

9 OOP Principles: Encapsulation
Hide state, Reveal Behavior Public Methods are Messages, Public Data Private Methods, Private Data Human Eyes Hands Legs Stomach Get Eye Shake Hands Walk Stop Eat Sit Digest Information Hiding

10 OOP Principles: Inheritance
Is-a relationship between classes. Classes are extended. Base, parent, child.

11 OOP Principles: Polymorphism
Taking more than one form. Same action, performed differently.

12 Relationships: Composition
Has-a relationship Strong type (die if parent dies).

13 Relationships: Aggregation
Has-a relationship Weak type (lives if parent dies).

14 Relationships: Association
Uses-a relationship Life time of the objects is independent.

15 SOLID: Single-responsiblity principle
Each class should have one and only one reason to change

16 SOLID: Open-closed principle
Each class should be open for extension and closed for modifications.

17 SOLID: Liskov’s substitution principle
Derived types must be completely substitutable for their base types.

18 SOLID: Interface segregation principle
Clients should not be forced to implement interfaces they don’t use (no fat interfaces).

19 SOLID: Dependency Inversion Principle
Adding a new abstraction level, to decouple high-level modules from the low-level modules they depend on.

20 Static VS OOP Static as a concept destroys the OOP Principles and conceptual model. You can look at "static" with respect to the state of an object/class. So we got only two cases for the right use of static. "static" is used when you have a class which doesn't need to maintain state information for an individual object but instead state information be maintained for the class. Examples are static variables. The other thing is declaring a class itself as static where in object can not be instantiated instead, you can call the static methods which need not have its own state information.

21 What’s next? Design Patterns (understand and implement)
Conceptual Design Problems.

22 Thank You


Download ppt "Object Oriented Design & Analysis"

Similar presentations


Ads by Google