After we have covered a pattern in class, I want you to answer the questions here about it.
I want your answers on the Web.
Create a directory someplace in your web space. In this directory create an index.html file and in that file place your answers in a nicely organized fashion. Put some sort of index at the top of the page so I can see clearly which ones you have finished, and can jump quickly to each one.
Email to "stotts" title "COMP 723 Pattern Answer URL"
In the body of your email include the URL that gets me to
your answer page/directory.
This will be a one-time email... when I get the URL I will build mysefl an index for the class and will check it periodically to read your answers.
Items are due by class time on the dates indicated.
This assignment has two small parts
1) Starting with the Stack adapter program we looked at in class (StackDemo.java, the one that creats a Stack as an adapter class on the built-in Java Vector class), create a second adapter class that implements a Queue. I want you to adapt Stack with the Queue class. Use object adapter to do this (class adapter requires multiple inheritance). Do this by first adding a method "reverse" to the Stack class. Then you will be able to more easily use Stack to implement the behavior of a Queue.
2) Using the program BridgeDemo.java that we studied in class, add a new front end Stack abstraction. The program as I gave it to you has two stack abstractions... vanilla stack, and hanoi stack. Add a third: bubble stack, the behavior of which we studied back in the ADT part of class. A bubble stack has non-traditional push behavior. If you push as item onto a bubble stack, and that item value is already in the stack, then it is removed from where it is and put on top. Change the main program to exercise all 3 front end abstractions with both of the back end implementations.
Using the flyweight Java program as an example (the one with the window containing an array of buttons), and the proxy Java program (sets up a net socket and two of them talk over it), modify these to have each button communicate via proxy with a server process across the network.
The idea is to be able to get, from clicking each button, two kinds of information:
a) one kind is context-specific information (i.e., related to, or a function of, it (x,y) position in the grid) but this information must be computed from a remote process. b) The other kind of information also has to be computed remotely, but once computed for a button type, it will remain the same for all buttons of that type. Moreover, we don't want to compute all this information if it is never requested.
We will get these two kinds of information by either a left-click on a window button (giving information type a) or a right-click (giving information type b)
So you create one or more proxies . A proxy is talked to when a cell is clicked. If this is the first time a button of this type has been clicked, the proxy goes remote and computes the context specific information, and the one-shot information. It caches the one-shot information so that future button clicks on the same type will not require recomputation.
Lets have 2 types of button clicks... left mouse, and right mouse. Left mouse will request the (x,y) specific information for the button. Right click will request the one-shot information... so left click will always require a remote access via the proxy. Right click will only require remote access for the first such click on a button of each type.
You are free to decide what specific functions the remote server process will be computing from the button information sent to it. You are also free to decide if it is a better design to use one proxy that all buttons talk to, or if you need a different proxy for each button type. You might choose either way, depending on what kind of information is being computed at the remote server, and how that information in employed in the client (window) process.
A4
(due 10/08/07 Mon classtime)
(via email to "stotts" title "COMP 723 A4")
(team work)
Produce a small program in Java or C++ that uses factories, an abstract factory to gen them, and a composite pattern to do something. I dont care what it does... use the example Java code we have done in class as a guide for the complexity I am looking for here.
A3
(due 09/17/07 Mon classtime)
(via email to "stotts" title "COMP 723 A3")
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
nah: LIB x BOOK x PERSON --> LIB
has: LIB x BOOK --> boolean
num: LIB x BOOK --> int
avail: 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 person "int" 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
nah 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
num tells how many copies exist in the library
avail tells how many copies are available for checking out
A2
(due 09/10/07 Mon 3:30 pm )
(via email to "stotts" title "COMP 723 A2")
A1
(due 08/26/07 Sun 11:59 pm )
(via email to "stotts" title "COMP 723 A1")
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.