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 204 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.
Also include links to the previous on-line stuff for the project, like USE cases, etc. Make me a page that is the single access point for all the information about your project.
Include a written discussion of your design decisions. What did your choices exclude, what did they allow the system to do well, what are the weaknesses of your design (how is it not flexible, or where is it likely to be hard to extend, maintain, etc.), any interesting consequences of your design decisions, assumptions you made, anything that will help me understand and appreciate the work you have done.
Writing code is not a requirement. Writing interfaces, header files, interface definitions, etc., should be done... it will help you get across the points you are trying to make.
Modify your Flyweight/Proxy program to use Commands. For this one you will not need the network server, as it will be a single program. You will need to create command subclasses for each type of button, and you will also need handler subclasses for each type of button. I suggest you choose a small number of buttons types... like maybe 3.
Listen to the left mouse button only. Mouse clicks will be responded to in pairs. The first mouse click will indicate what sort of handler will be used to process a command; the button type will determine this. The second mouse click will determine what command is dispatched (again, based on button type). For example:
As before you have some leeway in designing what the commands actually do. Each command should clearly compute some different function from the others. Each command should compute something that is a function of (x,y) coordinates. Each handler should present the command-computed values in a different format... like a text-output handler, an html-output handler, a binary/octal/whatever handler, an xml-output handler, etc.
Using the flyweight Java program as an example (the one with the 21x21 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.
There will be a proxy for each type of button (we have type 0-6 in the class example, but this is a code parameter). The idea is to have each button click produce two kinds of information: some that 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. The other 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.
So you create a proxy for each type of cell (in the class example we had cells 0-6, but this is a code parameter). The 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 saves 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.
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.
Design an XOR function in lambda calculus. Express it in lambda calculus, then also express it in ML and show via testing that it works for all cases. Or, show what cases it works for. If you wish, you may use this file as ML encodings for the Church numerals and basic booleans of lambda calculus. We will have it laying around when we run your solutions. If you wish to use other definitions, feel free to do so, just remember you will have to have them appear textually in the ML you hand in.
CTL Model Checker in ML
To hand in this assignment, email me the URL of a place where
I can find the code you wrote, any explanations you may have,
and the output for your program run on the CTL formulae I
gave you as well as on the formulae you made up.
For both parts, 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.
(part 1)
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
(part 2)
Design an ADT "BT", a binary search tree. You are free to
create and define it as you wish as long as it does the basic things
one wants of a BT: add left and right children, store and retrieve
values for nodes, etc. those sorts of things.
Make sure you have enough functions for it to be used to build and
employ as an index, for example... where I can add new words, and they
go into the tree so that some sorted order is maintained.
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.