, ,

[SOLVED] Cse 4361 homework 1 to 4 solutions

$25

File Name: Cse_4361_homework_1_to_4_solutions.zip
File Size: 320.28 KB

Categories: , , Tags: , ,
5/5 - (1 vote)

This homework requires the student to design a simple application implemented in Java by applying the controller pattern, the iterator pattern and the composite pattern. When the application starts, it displays a
window containing two buttons and a drawing area. The buttons are labeled “Circle” and “Box,” respectively.
When one of the buttons is clicked and then the mouse is pressed in the drawing area, the corresponding shape
is added to the collection of shapes of the composite. Moreover, all the shapes stored in the composite are
repainted on the drawing area. Figure 1 shows a sample window with a circle and a box created.

Figure 1: Sample window with a circle and box created
2 What to Produce and Submit
The student is required to produce and submit the following:
1. Produce and submit a domain model class diagram (DMCD) for the simple application. The DMCD may
contain only a few class but this is fine for this homework.
2. Produce and submit a design sequence diagram for the simple use case of the application. The design sequence diagram must apply the controller pattern, the iterator pattern and the composite pattern. It must
also clearly separate the presentation (i.e., the graphical user interface) and the business objects. That
is, all business-object related processing must take place in the business-object layer, not the presentation
layer. Use UML stereotype or UML note to show the patterns you apply.
3. Produce and submit a design class diagram for the simple application. Use UML stereotype or UML note
to show the patterns you apply.
1
4. Implement the design in Java. You may use Swing or AWT, whichever you prefer. Provide comments in
your code to show the patterns you apply.
5. Compile and run your application. Add a circle, a box, another circle, and another box. Produce and
submit the screen shot.
3 How To Submit
To be announced by the TA before the deadline.

1 Introduction
This individual homework requires the student to modify homework 1 design and implementation. The enhancement requirements are as follows:
1. The software shall have a Hello-World button in addition to the Box and Circle buttons. The behavior of
this button is the same as the Box and Circle buttons except that it draws a “Hello world” string in the
drawing area. You decide the font and font size of the string.
2. The software shall support undo and redo. This requires you to add another two buttons to the button
jpanel. You are required to apply the command pattern to support this functionality.
3. Apply the adapter pattern, if you had not done so in homework 1, to convert the various Java listener
interfaces that you use to the interface of the controller. The Java listener interfaces may include an action
listener’s actionPerformed(…) method, or a mouse listener’s mousePressed(…) method, etc. That is, each
of the five buttons will have its own action listener, and the mouse pressed event will also have its own
mouse listener. These listeners will adapt their respective listener interfaces to the respective methods of
the controller.
You may have done so for homework 1. If so, you just reuse your solution and apply it in homework 2.
2 What Needs to be Done and Submit?
This homework requires the student to do the following:
1. Modify your domain model according to the new enhancement requirements.
2. Extend your design sequence diagram (DSD) to accommodate the new requirements and apply the command and adapter patterns. The patterns you applied in homework 1 must still be applied in homework
2. Use UML stereotype or UML note to show the patterns applied.
3. Modify your design class diagram, which must be derived from the modified design sequence diagram and
modified domain model. Use UML stereotype or UML note to show the patterns applied.
4. Modify your Java implementation to support the new requirements and patterns applied. Provide comments in your code to show all of the patterns applied.
5. Compile and run your application. Arbitrarily add a few circles, boxes, and/or hello-world strings, as well
as click the Undo and Redo buttons in between the drawing actions to test your software. Produce and
submit screen shots to show the working of your software.
3 How To Submit
To be announced by the TA before the deadline.

Discuss the similarities and differences of the patterns in each of the following groups of patterns. Moreover,
describe two situations that are not in the reference books or taught in class such that each pattern should be
applied exclusively to exactly one situation. Describe how each pattern is applied and why the other pattern(s)
must not be applied.
1. Command and object adapter
2. Flyweight, singleton and prototype
3. Bridge and strategy
1.1 What To Submit
Submit answers in a Word or PDF document. The answers may include tables and figures if these help explain
your solutions and facilitate understanding. However, only tables and figures are not enough, you must explain
your solutions to help the reader understand.
The document must not exceed eight pages of font size at least 11 points. These eight pages include a cover
page (which is optional) and other items such as figures, diagrams and tables.
2 How To Submit
To be announced by the TA before the due date.

This individual homework requires the student to modify homework 1 design and implementation to apply the
state pattern. In homework 1, a variable had been used to keep track of the state of the controller, and respond
to the GUI events according to the state. This approach results in high complexity, especially when there are
many states and many triggering events. This homework requires the student to apply the state pattern to
reduce the complexity.
2 What Needs to be Done and Submit?
This homework requires the student to do the following:
1. Produce a state machine to describe the state-dependent behavior of the controller.
2. Apply the state pattern to produce a design for above state-dependent behavior. That is, apply the state
pattern to convert the state machine into a UML class diagram.
3. Modify homework 1 design class diagram to include the state pattern design produced above. Use UML
stereotype or UML note to show the state pattern.
4. Modify homework 1 design sequence diagram (DSD) to include application of the state pattern. Use UML
stereotype or UML note to show the state pattern.
5. Modify homework 1 Java code to apply the state pattern. Provide in-code comments to show the state
pattern.
6. Compile, run and test your software. Produce and submit screen shots to show the working of your
software.
3 How To Submit
To be announced by the TA before the deadline.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Cse 4361 homework 1 to 4 solutions[SOLVED] Cse 4361 homework 1 to 4 solutions
$25