SE2811 Weekly Outcomes

W1

  1. Define the meaning of the term Design Pattern.
  2. State the motivation behind Design Patterns.
  3. State the three primary classifications of Patterns, and explain them.
  4. Explain when it makes sense to provide some implementation in an abstract class, even though the class is not instantiable
  5. Explain when use of an abstract class may be more favorable than use of a pure interface
  6. Explain how the Strategy pattern delegates behaviors to separate classes.
  7. Explain the meaning of the term coupling; explain low (loose) coupling vs. high (tight) coupling
  8. Explain the meaning of cohesion; explain low cohesion vs. high cohesion
  9. Explain why low coupling and high cohesion are characteristics of a good design
  10. Explain the principle of Extend, don't Modify (also called the Open-Closed Principle)
  11. Identify and make use of appropriate connectors in UML class diagrams that illustrate generalization (Java extends), realization (Java implements), composition, and usage, along with labeling connectors to indicate navigability (arrows), multiplicity (numbers), and end roles (attribute names)

W2

  1. Explain the meaning of a Thread and its purpose.
  2. Apply multithreading using the Java API to create and start multiple threads (both worker Threads and Timer threads)
  3. Explain the purpose of the Runnable interface and its association with  the Thread class
  4. Explain the purpose of the ActionListener interface and its association with the Timer class
  5. Identify the thread on which a Timer executes.
  6. Apply Anonymous Inner Classes to the implementation of threads (e.g. Runnable, ActionListener)
  7. Explain the purpose of Thread synchronization.
  8. Create synchronized methods and synchronized blocks of code.
  9. Synchronize Threads using notify() and wait() methods from the Java API.
  10. Explain the concept of thread-safety as to how it pertains to non-thread-safe classes such as those of the JCF.
  11. Explain why modifications or updates to a UI, once the UI is made visible, should only be done on the Event Dispatch thread.

W3

  1. Explain the context, intent, and motivation of the Singleton Pattern
  2. Explain the concept of Eager vs. Lazy initialization of the Singleton's object
  3. Describe the specific consequences (advantages/disadvantages) of the Singleton Pattern
  4. List the principal methods of each main Singleton class
  5. Explain how a Singleton instance is created in the absence of a Singleton constructor
  6. Implement the principal methods of the main classes
  7. Identify candidate applications that could implement the Singleton pattern
  8. Apply the Singleton pattern to a specified application
  9. Explain the performance issues associated with declaring a Singleton's getInstance() method synchronized, and how double-checked locking is used to overcome this problem.

W4-5

  1. Explain the context, intent, and motivation of the Observer Pattern
  2. State the two principal interfaces comprising the Observer Pattern
  3. List the principal methods defined by the Observer and Subject interfaces
  4. Implement the principal methods of the each interface in concrete classes
  5. Explain the concept of Push vs. Pull with respect to how an Observer acquires an update from a Subject
  6. Describe the specific consequences (advantages/disadvantages) of the Observer Pattern
  7. Identify candidate applications that could implement the Observer pattern
  8. Apply the Observer pattern to a specified application
  9. Explain and apply the SwingUtilities.invokeLater() method to invoke a method on the UI dispatch thread of a Swing GUI application
  10. Explain the concept of coupling between classes, and the motivation for minimizing coupling
  11. Explain and apply the paradigm of "Program to an Interface". This principle can also apply to programming to an Abstract Class for cases where Abstract Classes are used instead of Interfaces.
  12. Explain and Demonstrate Programming to an Interface (or abstraction)

W6

  1. Explain the context, intent, and motivation of the Decorator Pattern
  2. List the principal attribute defined within the abstract class that defines an Abstract Decorator which concrete Decorates extend
  3. Explain and apply the paradigm of the Favor Composition over Extend principle with respect to the Decorator Pattern.
  4. Describe how the Decorator Pattern is applied in the java.io package to various Java I/O classes, such as OutputStream, FileOutputStream, FilterOutputStream, along with the corresponding InputStream-related classes
  5. Apply the Decorator pattern to implement a FilterOutputStream-based or FilterInputStream-based I/O concrete Decorator class that manipulates the data within an output or input stream.
  6. Apply the Decorator pattern to extend the behavior of graphical shapes.

W7

  1. Describe how the Composite Pattern is applied to create hierarchical structures composed of nodes known as Parts (or Leaf's) and Composites, which both implement the behavior defined by the abstract Component class.
  2. Explain how the Composite Pattern allows all objects (Parts and Composites) of a hierarchy to be treated uniformly, since they both implement Component behavior.
  3. Identify the principal behaviors defined by the Component abstraction.
  4. Illustrate the relationships between the primary classes of the Composite Pattern.
  5. Apply the Composite pattern to create hierarchies of objects such as computer components and subsystems.
  6. Apply the Composite pattern to create hierarchies of graphical shapes.
  7. Explain how the ability for a client application to treat all elements of a Composite Pattern uniformly (also known as transparency) violates the Cohesion Principle, since the Component abstraction defines both Part (Leaf) and Composite behavior, and also weakens Type Safety.
  8. Describe how the Command Pattern represents a request to an object (that is, a command) as another type of object, which can be stored and passed around like any other object.
  9. Identify the primary classes of the Command Pattern: the Command interface, one or more concrete Commands which implement the interface, a command Invoker, and a context-specific Receiver.
  10. Identify the principal behaviors defined by the Command interface and the Invoker abstraction.
  11. Illustrate the relationships between the primary elements of the Command Pattern in a UML class diagram.
  12. Explain how the Invoker may "buffer" concrete Command object references in a Stack or other data structure for purposes such as deferred execution, or supporting "undo".

W8

  1. Describe how the Factory Pattern is used to define an interface for object creation in that is implemented in a Factory class - the interface consists of methods known as Factory Methods.
  2. Describe the principal behavior defined by the Factory pattern as object creation.
  3. Explain that object creation cannot be effectively be implemented in the constructor method of an abstract Factory class, since constructors cannot be overridden in concrete subclasses.
  4. Explain how the Factory Pattern forces concrete Factory classes to implement Factory Methods by overriding the Factory Methods declared in the abstract Factory class
  5. Explain how the Factory Pattern delegates the creation of objects to the concrete Factory subclasses of the abstract Factory class..
  6. Identify the primary classes of the Factory Pattern: the abstract Factory class (or interface), and one or more concrete Factories which implement the Factory Methods.
  7. Illustrate the relationships between the primary elements of the Factory Pattern in a UML class diagram.
  8. Describe how the Abstract Factory Pattern method is used to create different types of concrete Factories, thus abstracting the process of creating the Factories.
  9. Illustrate the relationships between the primary elements of the Abstract Factory Pattern in a UML class diagram.
  10. Explain how the Abstract Factory Pattern supports the Dependency Inversion Principle, wherein a client application depends on (high-level) abstractions (abstract classes and interfaces) rather than (low-level) concrete components, but also that low-level components depend on behaviors defined within high-level abstractions

W9

  1. Explain the context, intent, and motivation of the Proxy Pattern
  2. Define the function of each of the following proxies: Stub Proxy, Virtual Proxy, Remote Proxy
  3. Describe the contexts in which the Stub Proxy, Virtual Proxy, and Remote Proxy patterns apply
  4. Describe how the Visitor Pattern encapsulates algorithms that need to be performed on an object (or more than one object) as objects known as Visitors.
  5. Apply the Visitor pattern to computing various metrics to a hierarchical structure of components (which implement the Composite Pattern).
  6. Describe the principal behavior defined by the Visitor interface as object visitation, which requires the object to implement a method that allows it to accept a Visitor.
  7. Explain how implementing the Visitor pattern breaks the principle of "Extend, don't Modify" by requiring modification to classes that will support being visited (since the acceptVisitor() method must be implemented in such classes).
  8. Explain how encapsulation may be compromised on classes that support Visitors, since those classes may have to provide sufficient access (via public methods or public attributes) for a Visitor to perform its intended function.
  9. Explain how a the problem above may be reduced by having a class that permits Visitors to visit it may instead provide access via a nested inner class that is only provided to Visitors.
  10. Illustrate the relationships between the primary elements of the Visitor Pattern in a UML class diagram.