The following diagrams show a model for a drawing application. Refactor the class diagram and sequence diagram using the Visitor design pattern. Justify pros and cons of the refactored model. (1.5 points) Window DrawingStructure add(s:Shape) delete(s:Shape) draw() Shape draw() Circle Box draw() draw() b1:Box c1:Circle c2:Circle :Window :ObjectStructure b1:Box c1:Circle c2:Circle draw() draw() draw() draw()
Added by Gema S.
Close
Step 1
In the original class diagram, we have a Window class, a DrawingStructure class, and a Shape class. The Window class has methods addShape(Shape), deleteShape(Shape), and draw(). The DrawingStructure class has a relationship with the Shape class, indicating that Show more…
Show all steps
Your feedback will help us improve your experience
Dominador Tan and 97 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
With the creation of the use case diagram, you should be able to create a model (or table) showing each object. For each object, be sure to outline associated attributes and methods. Hopefully, the use case diagram and the DFD will make this process fairly straightforward.
Dominador T.
User Registration Page Database Main Page Register (Input) Verify input Verification Res A [Valid Input] Add New User Redirection [Non Valid Input] - Display Error
Supreeta N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD