Object Oriented Analysis and Design with UML2 part2


Published on

Object Oriented Analysis and Design with UML2

Published in: Technology, Education
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Use case realization is the set of class diagrams and interaction diagrams that implement a use case
  • Data model that can be changed to domain model
  • There is no such thing as a "correct" list. It is a somewhat arbitrary collection of abstractions and domain vocabulary that the modelers consider noteworthy
  • Fact: Each responsibility is an axis of change. Reminder: We must agree that if a change occurred on a class, then all the dependencies must be: Rebuild Retest Redeploy Because we have many responsibilities then we have many reasons to change which means a huge rebuild, retest and redeploy for all the clients
  • Geometric Rectangle has less reasons to change which means less probability to change the class. But if you are sure it will change, then use Design Patterns (Strategy design pattern)
  • LSP violation means you need to re-design your abstractions hierarchy.
  • Through the discussion of SOLID principles, we show some useful principles to apply through the design by showing classes with problems and solving them; but we didn’t show how did we get these classes and how did we assign their responsibilities. In the following section we will talk about how to find the responsibilities and how to assign the proper responsibility to the proper class.
  • Object Oriented Analysis and Design with UML2 part2

    1. 1. Object-Oriented Analysis and Design with UML2 – Part 2 Presented By Haitham Raik
    2. 2. Agenda <ul><li>Part 1: </li></ul><ul><ul><li>OO Analysis and Design Overview </li></ul></ul><ul><ul><li>UML Overview </li></ul></ul><ul><ul><li>Requirements Overview </li></ul></ul><ul><ul><li>Use Cases Overview </li></ul></ul><ul><ul><li>Basic OO Concepts </li></ul></ul><ul><ul><li>Architectural Analysis </li></ul></ul>
    3. 3. Agenda (cont.) <ul><li>Part 2: </li></ul><ul><ul><li>Object-Oriented Analysis </li></ul></ul><ul><ul><li>Object-Oriented Design </li></ul></ul><ul><ul><ul><li>Design Principles Pyramid </li></ul></ul></ul><ul><ul><ul><li>Basic OO Design Principles (SOLID) </li></ul></ul></ul><ul><ul><ul><li>G eneral R esponsibility A ssignment S oftware P rinciples (GRASP) </li></ul></ul></ul><ul><ul><ul><li>Design Patterns </li></ul></ul></ul>
    4. 4. Part2 Agenda <ul><li>Object-Oriented Analysis </li></ul><ul><li>Object-Oriented Design </li></ul><ul><ul><li>Design Principles Pyramid </li></ul></ul><ul><ul><li>Basic OO Design Principles (SOLID) </li></ul></ul><ul><ul><li>G eneral R esponsibility A ssignment S oftware P rinciples (GRASP) </li></ul></ul><ul><ul><li>Design Patterns </li></ul></ul>
    5. 5. Object-Oriented Analysis Now We are Here
    6. 6. Object-Oriented Analysis <ul><li>Also called Use Case Analysis </li></ul><ul><li>Performed by the designer. </li></ul><ul><li>Input: </li></ul><ul><ul><li>Use Case Model </li></ul></ul><ul><ul><li>Logical Architecture </li></ul></ul><ul><li>Output: </li></ul><ul><ul><li>Domain Model/Analysis Model/Conceptual Model </li></ul></ul>
    7. 7. Object-Oriented Analysis
    8. 8. Object-Oriented Analysis <ul><li>What is the Concept? </li></ul><ul><ul><li>It is an Idea, thing, or object that is essential to the business domain, without reference to implementation or technology. </li></ul></ul><ul><ul><li>For example, a banking system has the following concepts: </li></ul></ul><ul><ul><ul><li>Customer </li></ul></ul></ul><ul><ul><ul><li>Account </li></ul></ul></ul><ul><ul><ul><li>Transaction </li></ul></ul></ul><ul><ul><ul><li>Loan </li></ul></ul></ul><ul><ul><li>Concepts also called Analysis classes/Domain classes. </li></ul></ul>
    9. 9. Object-Oriented Analysis <ul><li>What is a Domain Model? </li></ul><ul><ul><li>It is a visual dictionary of noteworthy abstractions, domain vocabulary, and information content of the domain. </li></ul></ul><ul><ul><li>It is easier to understand the domain concepts in a visualize language. </li></ul></ul>
    10. 10. <ul><li>Step 1: How to find Concepts? </li></ul><ul><ul><li>Reuse or modify existing models. </li></ul></ul><ul><ul><li>Use a category list. </li></ul></ul><ul><ul><li>Identify noun phrases. </li></ul></ul>
    11. 11. <ul><li>Find Concepts - Reuse or modify existing models: </li></ul><ul><ul><li>First, Best, and easiest approach. </li></ul></ul><ul><ul><li>There are many published domain models and data models for many common domains, such as: </li></ul></ul><ul><ul><ul><li>Finance </li></ul></ul></ul><ul><ul><ul><li>Health </li></ul></ul></ul><ul><ul><ul><li>Inventory. </li></ul></ul></ul><ul><ul><li>References: </li></ul></ul><ul><ul><ul><li>Analysis Patterns by Martin Fowler. </li></ul></ul></ul><ul><ul><ul><li>Data Model Patterns by David Hay. </li></ul></ul></ul>
    12. 12. <ul><li>Find Concepts - Use a Category List: </li></ul><ul><ul><li>Examples from Flight Reservation and POS System. </li></ul></ul>Category Examples Transaction Sale, Payment, Reservation Transaction Line Item Sales Line Item Product or Service Item, Flight, Seat, Meal Roles, People or organizations Cashier, Customer Place Airport Physical objects Airplane Description of thing Flight Description Catalogs Product Catalog Containers of things Store
    13. 13. <ul><li>Find Concepts - Identify Noun Phrases: </li></ul><ul><ul><li>Identify the nouns and noun phrases in the use cases. </li></ul></ul><ul><ul><li>Filter the nouns using the following: </li></ul></ul><ul><ul><ul><li>Is it outside the system boundaries? </li></ul></ul></ul><ul><ul><ul><li>Does it have identifiable structure? </li></ul></ul></ul>
    14. 14. <ul><li>Find Concepts - Identify Noun Phrases: </li></ul><ul><li>Example - Process Sale: </li></ul><ul><li>A customer arrives at a checkout with goods to purchase. </li></ul><ul><li>The cashier starts a new sale . </li></ul><ul><li>The cashier enters item identifier . </li></ul><ul><li>The system records line item and presents a running total and product description . </li></ul><ul><li>Cashier repeats steps 3-4 until indicates done. </li></ul><ul><li>The customer enters payment information, which the system validates and records. </li></ul><ul><li>The system updates inventory . </li></ul><ul><li>The customer receives a receipt from the system and then leaves with the items . </li></ul>
    15. 15. <ul><li>Find Concepts - Identify Noun Phrases: </li></ul><ul><ul><li>List of Nouns: </li></ul></ul><ul><ul><ul><li>Customer (Outside of the system) </li></ul></ul></ul><ul><ul><ul><li>Checkout </li></ul></ul></ul><ul><ul><ul><li>Goods (I will rename it to Product) </li></ul></ul></ul><ul><ul><ul><li>Cashier (Outside of the system) </li></ul></ul></ul><ul><ul><ul><li>Sale </li></ul></ul></ul><ul><ul><ul><li>Item Identifier (does not have structure) </li></ul></ul></ul><ul><ul><ul><li>System (this is what we want to understand) </li></ul></ul></ul><ul><ul><ul><li>Line Item </li></ul></ul></ul><ul><ul><ul><li>Running Total (does not have structure) </li></ul></ul></ul><ul><ul><ul><li>Product Description </li></ul></ul></ul><ul><ul><ul><li>Payment </li></ul></ul></ul><ul><ul><ul><li>Inventory </li></ul></ul></ul><ul><ul><ul><li>Receipt </li></ul></ul></ul>
    16. 16. <ul><li>Find Concepts - Identify Noun Phrases: </li></ul><ul><ul><li>List of Nouns after filtering them: </li></ul></ul><ul><ul><ul><li>Checkout </li></ul></ul></ul><ul><ul><ul><li>Product </li></ul></ul></ul><ul><ul><ul><li>Sale </li></ul></ul></ul><ul><ul><ul><li>Line Item </li></ul></ul></ul><ul><ul><ul><li>Product Description </li></ul></ul></ul><ul><ul><ul><li>Payment </li></ul></ul></ul><ul><ul><ul><li>Inventory </li></ul></ul></ul><ul><ul><ul><li>Receipt </li></ul></ul></ul>
    17. 17. <ul><li>Step 2: Create Analysis Diagram/Conceptual Diagram </li></ul>
    18. 18. <ul><li>Step 3: Add Associations: </li></ul><ul><ul><li>Show associations when the knowledge of the relationship needs to be preserved for some duration (“need-to-remember” associations). </li></ul></ul><ul><ul><ul><li>For example: </li></ul></ul></ul><ul><ul><ul><ul><li>There is a need to remember the relationship between Sale and its Line Items (to calculate the total price). </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Cashier may look up product description, but there is no need to remember the relationship between Cashier and Product Descriptions. </li></ul></ul></ul></ul><ul><ul><li>Identify the type of relationship: dependency, association, or generalization. </li></ul></ul><ul><ul><li>For association relationships, identify the multiplicity. </li></ul></ul>
    19. 19. <ul><li>Review: Modeling Associations using UML </li></ul>
    20. 20. <ul><li>Association Naming: </li></ul><ul><ul><li>Name an association based on a: </li></ul></ul><ul><ul><li>ClassName-VerbPhrase-ClassName format, where the verb phrase creates a sequence that is readable and meaningful. </li></ul></ul><ul><ul><li>For example: </li></ul></ul><ul><ul><ul><li>Sale Paid-by Payment </li></ul></ul></ul><ul><ul><ul><li>Sale Contains Line Item </li></ul></ul></ul><ul><ul><ul><li>Line Item Records-sale-of Product </li></ul></ul></ul><ul><ul><ul><li>Product Description describes a Product </li></ul></ul></ul>
    21. 21. <ul><li>Associations Example: </li></ul>
    22. 22. <ul><li>Step 4: Add Attributes: </li></ul><ul><ul><li>Include attributes that the use cases imply a need to remember information. </li></ul></ul><ul><ul><li>Examples: </li></ul></ul><ul><ul><ul><li>Item Identifier </li></ul></ul></ul><ul><ul><ul><li>Sale total </li></ul></ul></ul><ul><ul><li>Applying UML: </li></ul></ul>
    23. 23. <ul><li>Add Attributes Guidelines: </li></ul><ul><ul><li>Attribute types should be primitives, such as numbers and Booleans (does not have structure). </li></ul></ul><ul><ul><li>Relate conceptual classes with an association, not with an attribute. </li></ul></ul>
    24. 24. <ul><ul><li>Add Attributes Guidelines (Cont.): </li></ul></ul><ul><ul><ul><li>No Attributes Representing Foreign Keys </li></ul></ul></ul>
    25. 25. <ul><li>Exercise: </li></ul><ul><ul><li>Create Domain Model for one of the use cases we have presented in Part 1 of the presentation. </li></ul></ul>
    26. 26. <ul><li>Domain Model and Domain Layer </li></ul><ul><ul><li>Software class names in the domain layer are inspired from names in the domain model </li></ul></ul><ul><ul><li>Software classes attributes in the Domain Layer are inspired from the Domain Model. </li></ul></ul><ul><ul><li>The Model in M VC is an old OO term from the late 1970s; it is a synonym for the Domain Layer. </li></ul></ul>
    27. 27. <ul><li>Domain Model is not a Data Model: </li></ul><ul><ul><li>Data model shows persistent data to be stored somewhere. </li></ul></ul><ul><ul><li>So do not exclude a class because </li></ul></ul><ul><ul><ul><li>The requirements don’t indicate obvious need to store the class. </li></ul></ul></ul><ul><ul><ul><li>The concept has no attributes </li></ul></ul></ul>
    28. 28. <ul><li>Recommended References: </li></ul><ul><ul><li>Applying UML and Patterns </li></ul></ul><ul><ul><li>Analysis Patterns by Martin Fowler. </li></ul></ul><ul><ul><li>Data Model Patterns by David Hay </li></ul></ul>
    29. 30. Part2 Agenda <ul><li>Object-Oriented Analysis </li></ul><ul><li>Object-Oriented Design </li></ul>
    30. 31. Object-Oriented Design Now We are Here
    31. 32. Object-Oriented Design <ul><li>Also called Use Case Design </li></ul><ul><li>Performed by the designer. </li></ul><ul><li>Input: </li></ul><ul><ul><li>Use Case Model </li></ul></ul><ul><ul><li>Logical Architecture </li></ul></ul><ul><ul><li>Domain Model </li></ul></ul><ul><li>Output: </li></ul><ul><ul><li>Design Model </li></ul></ul>
    32. 33. <ul><li>This objective: </li></ul><ul><ul><li>Learn what a good design mean. </li></ul></ul><ul><ul><li>Learn the basic principles of a SOLID design. </li></ul></ul><ul><ul><li>Learn the GRASP principles as a guidelines to create a SOLID design. </li></ul></ul><ul><ul><li>Learn the design patterns as common design solutions for common design problems </li></ul></ul>
    33. 35. <ul><li>What a Good Design Mean? </li></ul><ul><ul><li>It will lead to a system that: </li></ul></ul><ul><ul><ul><li>Meets the customer requirements. </li></ul></ul></ul><ul><ul><ul><li>Easy to understand. </li></ul></ul></ul><ul><ul><ul><li>Easy to maintain. </li></ul></ul></ul><ul><ul><ul><li>Easy to extend. </li></ul></ul></ul><ul><ul><ul><li>Re-usable. </li></ul></ul></ul>
    34. 36. <ul><li>Basic Principles of SOLID design: </li></ul><ul><ul><li>S ingle Responsibility Principle </li></ul></ul><ul><ul><li>O pen-Closed Principle </li></ul></ul><ul><ul><li>L iskov Substitution Principle </li></ul></ul><ul><ul><li>I nterface Segregation Principle </li></ul></ul><ul><ul><li>D ependency Inversion Principle </li></ul></ul>
    35. 38. <ul><li>Single Responsibility Principle: </li></ul><ul><ul><li>A class should have one and only one type of responsibilities. </li></ul></ul><ul><ul><li>If a class assumes more than one responsibility, then </li></ul></ul><ul><ul><ul><li>there will be more than one reason for it to change. </li></ul></ul></ul><ul><ul><ul><li>It will be highly coupled </li></ul></ul></ul><ul><ul><li>High probability of change for a high coupled class will lead to frequent huge rebuild, retest and redeploy (Not easy to maintain). </li></ul></ul>
    36. 39. <ul><ul><li>The Rectangle class has two responsibilities </li></ul></ul><ul><ul><li>Two different applications use the Rectangle class (high coupling) </li></ul></ul><ul><ul><li>Drawbacks: </li></ul></ul><ul><ul><ul><li>We must include the GUI in the computational geometry application (Not easy to reuse) </li></ul></ul></ul><ul><ul><ul><li>If one of the responsibilities changed, that change may affect the both clients which forces us to: </li></ul></ul></ul><ul><ul><ul><ul><li>Rebuild, retest, and redeploy the both applications. </li></ul></ul></ul></ul>
    37. 40. <ul><li>The solution: </li></ul><ul><ul><li>If Rectangle class changed, then only the Graphical Application will be affected (Easy to maintain) </li></ul></ul><ul><ul><li>But what about Geometric Rectangle class? If it changed it will affect the both applications, right? </li></ul></ul>
    38. 42. <ul><li>Open/Closed Principle: </li></ul><ul><ul><li>Can be used when a single change cascade changes to dependent modules </li></ul></ul><ul><ul><li>Module should be: </li></ul></ul><ul><ul><ul><li>Open for extension </li></ul></ul></ul><ul><ul><ul><ul><li>The behavior can be extended </li></ul></ul></ul></ul><ul><ul><ul><li>Closed for modification. </li></ul></ul></ul><ul><ul><ul><ul><li>No one is allowed to make a source code changes to it. </li></ul></ul></ul></ul><ul><ul><li>How can these two opposing attributes be resolved? </li></ul></ul><ul><ul><ul><li>By Applying Polymorphism </li></ul></ul></ul>
    39. 43. <ul><li>For example: </li></ul><ul><ul><li>If there is a need to change the Server class, we are forced either: </li></ul></ul><ul><ul><ul><li>To open the Server class and modify it which may affect the client (rebuild, retest, redeploy). </li></ul></ul></ul><ul><ul><ul><li>Or to create a new class “Server2” and change the Client class. </li></ul></ul></ul><ul><ul><li>The solution: </li></ul></ul><ul><ul><ul><li>If a change is required, we can create new implementation of the interface </li></ul></ul></ul>
    40. 44. <ul><li>Open/Closed Principle: </li></ul><ul><ul><li>Closed for Modification: </li></ul></ul><ul><ul><ul><li>Since the client depends on a fixed interface (or abstract base class). </li></ul></ul></ul><ul><ul><li>Open for extension: </li></ul></ul><ul><ul><ul><li>The behavior can be extended by creating new implementation (sub class) of the interface (base class). </li></ul></ul></ul>
    41. 46. <ul><li>Liskov Substitution Principle: </li></ul><ul><ul><li>Method that use reference to “Base Class” must be able to use objects of “Derived Class” without knowing it . </li></ul></ul><ul><ul><li>LSP is a complementary for OCP. </li></ul></ul><ul><ul><li>In other words, </li></ul></ul><ul><ul><ul><li>OCP says the client must interact with interface/base class </li></ul></ul></ul><ul><ul><ul><li>LSP says the client must not know any thing about the implementations/derived classes of that interface/base class. </li></ul></ul></ul><ul><ul><li>The Consequences of Violating LSP: </li></ul></ul><ul><ul><ul><li>Violating the LSP means the client must know about the implementation. </li></ul></ul></ul><ul><ul><ul><li>If the implementation changed, then the client will be affected. </li></ul></ul></ul>
    42. 47. <ul><li>The following code violates LSP: </li></ul><ul><li>public class Client { </li></ul><ul><ul><li>public void violateLSPMethod(ServerInterface server) { </li></ul></ul><ul><ul><ul><li>// This method must know about the impl class, which violates LSP </li></ul></ul></ul><ul><ul><ul><li>if (server instanceof ServerImpl1) { </li></ul></ul></ul><ul><ul><ul><li>//cast to ServerImpl1, then do something </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul><ul><ul><ul><li>if (server instanceof ServerImpl2) { </li></ul></ul></ul><ul><ul><ul><li>//cast to ServerImpl2, then do something different </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul><ul><ul><ul><li>// if a new implementation created, then we need to open this method and </li></ul></ul></ul><ul><ul><ul><li>// modify it, which violates OCP </li></ul></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>} </li></ul><ul><li>// Conclusion: Violating LSP will lead to violate OCP </li></ul>
    43. 48. <ul><li>LSP violation indicates that the abstractions hierarchy is not correct. </li></ul><ul><li>How to solve LSP violation: </li></ul><ul><ul><li>Re-design your abstractions hierarchy </li></ul></ul><ul><ul><li>For example: </li></ul></ul><ul><ul><ul><li>KingFisher is a Bird and it can sing and fly. </li></ul></ul></ul>
    44. 49. <ul><li>But what if we added Ostrich to hierarchy </li></ul><ul><ul><li>Ostrich is a bird but it can’t fly </li></ul></ul><ul><ul><ul><li>The client code must be changed to include the following: </li></ul></ul></ul><ul><ul><ul><li>if (bird instanceof Ostrich) { // Violate LSP </li></ul></ul></ul><ul><ul><ul><li>// don’t call fly method </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul>
    45. 50. <ul><li>Solution: </li></ul><ul><ul><li>Re-design your birds hierarchy </li></ul></ul>
    46. 52. <ul><li>Dependency Inversion Principle </li></ul><ul><ul><li>High level modules should not depend upon low level modules. Both should depend upon interface/base class. </li></ul></ul><ul><ul><li>DIP is a generalization for OCP and LSP </li></ul></ul><ul><ul><li>For example, we have a copy program that reads a char from keyboard and write the char to a printer. </li></ul></ul>
    47. 53. <ul><ul><li>In the previous example, we will have code similar to the following: </li></ul></ul><ul><li>void copy() { </li></ul><ul><ul><li>KeyboardReader r = new KeyboardReader(); </li></ul></ul><ul><ul><li>PrinterWriter w = new PrintWriter(); </li></ul></ul><ul><ul><li>int c; </li></ul></ul><ul><ul><li>While ((c = r.read()) != EOF) w.write(c); </li></ul></ul><ul><li>} </li></ul>
    48. 54. <ul><ul><li>What if we want to re-use the copy program, to read from keyboard and write to disk; The code will be changed as following: </li></ul></ul><ul><li>enum OutputDevice {printer, disk}; </li></ul><ul><li>void copy(OutputDevice dev) { </li></ul><ul><ul><li>KeyboardReader r = new KeyboardReader(); </li></ul></ul><ul><ul><li>PrinterWriter printer = new PrintWriter(); </li></ul></ul><ul><ul><li>DiskWriter disk = new DiskWriter(); </li></ul></ul><ul><ul><li>int c; </li></ul></ul><ul><ul><li>While ((c = r.read()) != EOF) { </li></ul></ul><ul><ul><li>if (dev == printer) printer.write(c); </li></ul></ul><ul><ul><li>else disk.write(c); </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>} </li></ul>
    49. 55. <ul><ul><li>Adding new device will increase the copy program dependency on low level implementations </li></ul></ul><ul><ul><li>The drawback of the dependency on low-level implementations is: </li></ul></ul><ul><ul><ul><li>Any change on any low-level implementation will lead to: Rebuild, Retest and re-deploy. </li></ul></ul></ul><ul><ul><li>The copy program in the previous example is not reusable (Not easy to re-use). </li></ul></ul>
    50. 56. <ul><ul><li>The solution: </li></ul></ul><ul><ul><ul><li>depend on interface/abstract base class (DIP) </li></ul></ul></ul><ul><ul><ul><ul><li>Low level implementation must depend on abstract class/interface </li></ul></ul></ul></ul><ul><ul><ul><ul><li>High level implementations (Policies) must also depend on abstract class/interface </li></ul></ul></ul></ul>
    51. 57. <ul><ul><li>After applying DIP, the code will be: </li></ul></ul><ul><li>interface Reader { </li></ul><ul><li>int read(); </li></ul><ul><li>} </li></ul><ul><li>interface Writer { </li></ul><ul><li>void write(int c); </li></ul><ul><li>} </li></ul><ul><li>// new impl. For copy program </li></ul><ul><li>void copy(Reader r, Writer w) { </li></ul><ul><ul><li>int c; </li></ul></ul><ul><ul><li>While ((c = r.read()) != EOF) w.write(c); </li></ul></ul><ul><li>} </li></ul>
    52. 58. <ul><li>Mitigating Forces </li></ul><ul><ul><li>The DIP makes the assumption that anything concrete is volatile (not stable). </li></ul></ul><ul><ul><li>There are exceptions, for example: </li></ul></ul><ul><ul><ul><li>the String class is a concrete class but stable. </li></ul></ul></ul><ul><ul><ul><li>Depending upon stable classes is not bad. </li></ul></ul></ul><ul><li>Object creation: </li></ul><ul><ul><li>To create an instance, you must depend upon a concrete class. </li></ul></ul><ul><ul><li>There is a solution to this problem: </li></ul></ul><ul><ul><ul><li>Dependency Injection (framework managed dependency injection), </li></ul></ul></ul><ul><ul><ul><li>Factory Design Pattern (Manual Dependency injection), </li></ul></ul></ul><ul><ul><ul><li>Service Locator </li></ul></ul></ul>
    53. 60. <ul><li>Interface Segregation Principle </li></ul><ul><ul><li>Client should not be forced to depend on methods they don’t need. </li></ul></ul><ul><ul><li>Sometimes, there are a need to violate SRP. </li></ul></ul><ul><ul><ul><li>One class has many responsibilities. </li></ul></ul></ul><ul><ul><li>ISP suggests that clients should not know about that as a single class. </li></ul></ul><ul><ul><li>Make fine grained interfaces that are client specific: </li></ul></ul><ul><ul><ul><li>Each client should know about one interface that have a single responsibility. </li></ul></ul></ul>
    54. 61. <ul><li>For example: </li></ul><ul><ul><li>Service class violates SRP (has many responsibilities) </li></ul></ul><ul><ul><li>The change on any of Client A method, will affect Client B and Client C. </li></ul></ul>
    55. 62. <ul><li>Solution: </li></ul><ul><ul><li>Create client specific interfaces. </li></ul></ul>
    56. 63. <ul><li>Recommended References: </li></ul><ul><ul><li>Applying UML and Patterns </li></ul></ul><ul><ul><li>Agile Software Development, Principles, Patterns, and Practices, Robert C. Martin </li></ul></ul>
    57. 65. <ul><li>Responsibility Assignment </li></ul>