Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Object Oriented Analysis and Design


Published on

The very fundamentals of object oriented development. Understanding real world cases and representing them as objects having state and behaviour.

Published in: Technology, Education

Object Oriented Analysis and Design

  1. 1. Object Oriented Programming Concepts Analysis + Design
  2. 2. What’s in store… <ul><li>Real world problems  software solution </li></ul><ul><li>Functionality – Requirements/Use-cases </li></ul><ul><li>Object Oriented [OO] Concepts </li></ul><ul><li>Unified Modeling Language [UML] </li></ul><ul><li>Simple Design Pattern </li></ul>
  3. 3. Real World Problems  Software Solutions <ul><li>1. Functionality - The code should do what it’s supposed to do </li></ul><ul><li>2. Analysis and Design - Application of basic OO concepts </li></ul><ul><li>3 . Frameworks & Design Patterns – Strive for a maintainable and scalable solution </li></ul>
  4. 4. Functionality – Requirements & Use-cases <ul><li>Requirements set out the final expectations from the system </li></ul><ul><li>Use-case enumerates in detail the steps the system should take </li></ul><ul><li>Use-case has a single goal </li></ul><ul><li>Every use-case has a start and stop condition, an external initiator and clear value </li></ul>
  5. 5. Functionality – Requirements & Use-cases <ul><li>A </li></ul><ul><li>B </li></ul><ul><li>C </li></ul><ul><li>… </li></ul><ul><li>UC 1 </li></ul><ul><li>UC 2 </li></ul><ul><li>UC 4 </li></ul><ul><li>UC2 </li></ul><ul><li>UC3 </li></ul><ul><li>UC4 </li></ul><ul><li>UC1 </li></ul><ul><li>UC4 </li></ul><ul><li>UC5 </li></ul><ul><li>UC6 </li></ul>Requirements
  6. 6. OO Concepts <ul><li>Everything is an Object </li></ul><ul><li>Everything consists of objects </li></ul>
  7. 7. OO Concepts – I N H E R I T A N C E <ul><li>Build classes based on other classes </li></ul><ul><li>Avoid duplicating and repeating </li></ul><ul><li>Inherit behaviour and change [ override ] if required </li></ul><ul><li>Sub-class should be substitutable for parent class </li></ul>
  8. 8. OO Concepts – P O L Y M O R P H I S M <ul><li>Change behaviour without changing code </li></ul><ul><li>Allows a sub-class to stand-in for another class </li></ul>
  9. 9. OO Concepts – E N C A P S U L A T I O N <ul><li>Protect information in your code from being used incorrectly </li></ul><ul><li>Object = state + behaviour </li></ul><ul><li>Also known as Information Hiding or Separation of Concerns </li></ul><ul><li>Duplicate code is an indicator </li></ul>
  10. 10. OO Concepts – C O M P O S I T I O N <ul><li>Loose coupling between objects </li></ul><ul><li>Greater flexibility </li></ul><ul><li>Code changes don’t lead to cascading code breakage </li></ul><ul><li>Better encapsulation </li></ul>
  11. 11. Unified Modeling Language – U M L <ul><li>Purely representational </li></ul><ul><li>Programming language independent </li></ul><ul><li>A notational set based language and NOT a methodology </li></ul><ul><li>Fits easily into any company’s way of functioning </li></ul><ul><li>Conveys information through a wide set of diagrams </li></ul><ul><ul><li>Use-case diagram </li></ul></ul><ul><ul><li>Class diagram </li></ul></ul><ul><ul><li>Sequence diagram </li></ul></ul><ul><ul><li>State-chart diagram </li></ul></ul><ul><ul><li>Activity diagram </li></ul></ul><ul><ul><li>Component diagram </li></ul></ul>
  12. 12. U M L – Use-Case Diagram <ul><li>Illustrates a unit of functionality </li></ul><ul><li>Helps visualize functional requirements of a system </li></ul><ul><li>Include relationships of actors [users] to processes </li></ul>
  13. 13. U M L – Class Diagram <ul><li>Shows the static structures and relationships of a system </li></ul><ul><li>Can be used to display logical groupings/classifications </li></ul><ul><li>Also used to depict implementation classes </li></ul><ul><li>Both the state and behaviour of classes captured </li></ul><ul><li>Relationships between classes also important </li></ul>
  14. 14. U M L – Sequence Diagram <ul><li>Depicts in detail the flow of control through a use-case </li></ul><ul><li>Consists of 2 dimensions – </li></ul><ul><ul><li>Horizontal – shows sequence of calls/messages in time order of occurrence </li></ul></ul><ul><ul><li>Vertical – the object instances to which messages are sent </li></ul></ul><ul><li>Sequence of flow starts at the top left corner </li></ul>
  15. 15. A Design Pattern – D E L E G A T I O N <ul><li>An object outwardly exhibits a behaviour – which is performed by another object </li></ul><ul><li>Better encapsulation </li></ul><ul><li>Impact of code changes minimised </li></ul><ul><li>Sometimes referred to as aggregation </li></ul><ul><li>Example – A stack built on top of a list </li></ul>
  17. 17. References <ul><li>UML Basic: An Introduction [IBM] </li></ul><ul><li>Head First - Object Oriented Analysis and Design </li></ul><ul><li>Wikipedia </li></ul>