|Due at Friday, June 25th, 23:59|
Consider the following instance of the proxy pattern representing the structure of images in a website:
We've created a simple chat application called “Chatter” with RAP.
Check out the “A9T16_Chatter” project from your repository.
The application has a certain problem: Once a client starts it, the messages are loaded from the shared MessageHistory, but afterwards, nothing is updated. You can't even see your own messages!
Your task is to implement an Observer Pattern to solve this problem.
Write a program that demonstrates the advantages of the Composite design pattern. The program should create a tree of objects consisting of both composite and leaf nodes (demonstrating that the composite has correctly implemented a subset of the child management functions, such as addChild(), getChild(), and getParent()). Make sure that your tree consists of at least three levels, e.g. a root node with multiple children, where at least one of those nodes is a composite node with children. The program should then call an operation on the root of the tree. All composite objects should delegate the operation to their children while all leaf nodes should perform the action. Optionally the composite nodes can do something in response to the operation but they should then delegate the operation to their children.
Describe the Liskov's Substitution Principle in your own words. For a more detailed discussion see
Is overriding in general a dangerous concept?
Take a look at the cyclic dependency expressed in the following UML class diagram: Can you think of a way to break this cycle without loosing any functionality?
Hint: there is a well-known design pattern that is typically used in situations like this.