Patterns covered so far in class:
Here are the requirements for the online voting system. You are producing a design for this system, using OO design patterns. Prepare your materials on a web page (or several) and add the link to your class webspace by the due date (which is the date of the in-class presentation). As with the other team work, each team will produce a joint product, but each team member will link to that product separately in his/her personal class web space.
You will present your design and give the rationale for it in class in our exam slot, which is 12pm Friday, May. 3. We will have 3 hours to do 11 team presentations, so prepare for a 15 minute talk. Please practice yours and time it so you know it fits the alloted time.
The design should be explained as a collection of class/object diagrams (as the design patterns are expressed in), with interfaces defined at a top level (important methods and fields, but not necessarily full details). If you want to or need to, you can use the other diagrams from you text, such as sequence and timing diagrams. Show where the patterns involved are, list them and explain what part of the system functionality they are providing. Give your rational... why did you choose certain patterns and structures, and reject others? Be prepared to explain your design decisions.
Prepare an in-class presentation... powerpoint, web pages, whatever is fine for the presentation materials. No matter what form you use, please put the presentation materials in your submitted web information.
Do this assignment as a project team.
Each member of the team will submit the solution via their individual class webspace, but the work will be jointly done by pair programming. Put your source code files on the web so I can look at them with a browser.
Observer in AspectJ
You will write a simplfied program that has the Observer pattern, but the Observer pattern will be implemented using aspects in AspectJ. You may use the AspectJ observer example we studied in class as an implementation guide. In this example, the communication protocol that ties together an observer and its subject is implemented in aspects, and the core logic of how the subject is manipulated is implemented uncluttered in Java.
Let's start with the command demo program that has a GUI with 3 buttons and a file menu ("DemoWithCommands"). Add an observer that is watching for color changes and will make a report when the background color is altered (this happens with the 3 buttons, and with the file menu "Clear" selection). This means the data state is the background color and the subject is the frame object. When the observer is told of a state change, just do something simple like print out the color name with System.out.println. Feel free to do something different, but that is all we need to do.
One other design goal you should try to satisfy: write the AspectJ program so that the main application (the DemoWithCommands GUI) still compiles and runs as Java without the Observer additions. More or less... leave the DemoWithCommands code unaltered; if you alter it, make the alterations be Java.
Do this assignment as a project team.
Each member of the team will submit the solution via their individual class webspace, but the work will be jointly done by pair programming. Put your source code files on the web so I can look at them with a browser.
Networked Observer Exercise
The program description is lengthy, so get it here.
Do this assignment as a project team.
Here are the requirements for the online voting system.
Using your user stories as requirements, develop CRC cards as your initial system design. Put them online on your course web page, and be ready to discuss them in class on the due date. Develop the cards as a team, then each person put them onto your personal class web space.
You may scan the cards as images, or type them into a document. But to develop them, use physical cards in the design session. You may take normal printer paper and cut it into card sizes if you dont have index cards... no need to buy them.
Information about the CRC card technique can be found in the "NOTES" section of the class webpage.
Do this assignment with or without pair programming, your choice
Using Proxy and Chain of Responsibility (and almost Flyweight)
The program description is lengthy, so get it here.
Each person will submit the solution via their class
webspace; if the work is done as a team, each team member will
submit the same program code.
Put your source code files on the web so I can look at
them with a browser.
Do this assignment as a project team.
Complete your user story document and put it on your class work webpage. This collection will serve as your requirements for the online voting system design. Use the two class discussions we had as guidance for the different functions the system must provide to the different kinds of users.Each team will create one document, and each team member will link the document to his/her webspace. Make sure the document identifes both (all) team members.
Do this assignment with pair programming. Two people, one typing at the computer.
Each member of the team will submit the solution via their class
webspace, but the work will be jointly done.
Put your source code files on the web so I can look at
them with a browser.
Produce a program in Java or C++ that uses factories to generate objects, and a composite pattern to organize them. The structure you should create is a ballot for handling elections at any number of multiple levels (e.g., national, state, local). Use the example Java code we have done in class as a guide. Follow the more complicated example for the drawing canvas; I want you to clearly define the interfaces that create the common operations for the leaf and inner nodes of the composite. Make your composite interface have at least three common methods (3 or more methods that are provided by both inner and leaf nodes). I will leave it up to you to design an appropriate collection of ballot-related operations. The main thing to remember is the point of the composite: for the common operations, the leaf level and the inner levels look the same.
You will also need some client code to build and exercise the composite structure. In this case, the client code will simulate at a very high level an election... creating ballot(s) and using them to cast votes.
Provide some documentation on the web page that explains your solution to the problem, specifically the operations you put into the common interface. Also document how to run the program... what input to provide, and a description of what sort of output is generated.
We will work as two-person teams on some of the assignments in this course. If you want to form a team with a classmate please email me the two names.
For anyone who does not form your own team, I will make assignments after the due date above.
Use ML to express the axioms you write. Using ML will also allow you to check the behavior to see if you have expressed what you intended.
Using Guttag's hueristic, give consistent and complete algebraic specs for this ADT (class):
LIB (library) new: -> LIB add: LIB x BOOK -> LIB rem: LIB x BOOK -> LIB cko: LIB x BOOK x PERSON -> LIB cki: LIB x BOOK x PERSON -> LIB wait: LIB x BOOK x PERSON -> LIB off: LIB x BOOK x PERSON -> LIB has: LIB x BOOK -> boolean here: LIB x BOOK -> int num: LIB x BOOK -> int new makes a LIB with no books, no wait lists, etc. add puts another copy of a book in the library rem takes a copy out of the library cko allows a person to check out the book cki checks the book back in; if there is a person on wait list it does a cko to that person. wait puts person at the back of a waiting list for a book off takes a person out of the waiting list for a book has tells if a book exists in the Library (even if all copies are checked out here tells how many copies of a book are available for checking out num tells how many copies total of a book exist in the libraryYou can use string for PERSON. Use int for BOOK (like a simplified ISBN).
When picking the canonical constructors, consider the data structures that must be kept internally by the library. Some canonical constructor will be needed to build each of these structures.
Hand in your work via the website you are keeping for the class, the one you sent me the URL for in assignment A2. Do it similar to this web page and this example, meaning make me a web page with a link to the text of each ADT in ML
Email to me a URL for a web page that you will keep for this class. On this web page please put your name and email adddress. Then add links for your work as the semester progresses. The page will include links to your individual work, as well as to the work you do as a team.
Answer this question: What is software design?
I am not looking for pages, but I would like you to give it enough thought that you can answer with a good paragraph or two. Prepare this answer for the next class. Email it to me by the time I have indicated so I can take a look before the next class, and so you will be prepared to discuss this next time.