CS 4233 Review Feb
February Review2 Outline Previous Business – My.wpi.edu contains all grades to date for course – Review and contact TA/prof for questions New Business – HW5 solution due tomorrow 5:00 PM
February Review3 TAOO: Questions What is the difference between links and associations? What is the practical impact of maintaining a bidirectional association? What is difference between aggregation and composition? What is difference between (1) Class C extends class A; and (2) Class C uses class A as a servant class.
February Review4 TAOO: Questions How are N-ary relationships implemented? – Describe associations and links – How are core operations relevant to N-ary relationships? How is a collection manager different from a container? Backward Containment vs. Forward Containment
February Review5 Java and OO Polymorphism, Sub-classes Interfaces, Sub-interfaces Methods Access (public, protected, private) Static methods
February Review6 Model View Controller MVC – its variations – responsibilities assigned to M, V, and C Use in GUIs Precursor to EBC
February Review7 Entity Boundary Controller EBC as consolidated approach to analysis – Use cases Control, Boundary objects – Domain Analysis Entity objects Describe interactions between controllers Controllers can be abstract to represent commonalities – Specialized subclasses contain variations
February Review8 EBC All objects are not created equal – Entity Represent persistent information required to implement desired system – Boundary Represent interactions between actors and system – Control Represent tasks that are performed by user and supported by system
February Review9 EBC Boundary object presented to user – Event/action takes place Controller created (or invoked) to manage behavior Controller may display add’l boundary Controller manages updates to entities and boundaries
February Review10 Object properties Cohesion Coupling Communication with other objects Sequence diagrams
February Review11 Law of Demeter Within a method, messages can only be sent to 1. Its enclosing object 2. A parameter of the method a.For pragmatic reasons: includes global objects 3. Attributes of the enclosing object a.Includes elements of a collection 4. An object returned by a method of the enclosing object 5. An object created within the method
February Review12 Demeter Summary Guideline for design Many reasons for ‘breaking’ its laws – Most are pragmatic and therefore unsound Replace micro-management with delegation
February Review13 Design Patterns Creational – Singleton Restrict access to the instance(s) of a class – Abstract Factory Provide an interface for creating families of related objects without specifying their concrete classes – Concrete Factory Consolidate all constructors in one place – Factory Method Delegate construction to subclasses
February Review14 Design Patterns Behavioral – Iterator Access elements of an aggregate object sequentially without exposing underlying representation – Visitor Define a new operation to be performed on elements of an object structure Avoid changing the classes of the elements on which the visitor operates
February Review15 Design Patterns Behavioral – Template Method Define skeleton of an algorithm, deferring steps to subclasses – Mediator Encapsulate how a set of objects interact – Command Encapsulate a request as an object