Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C# please 1. Consider the example in Assignment 1 (a canvas that can draw only circle and rectangle, disregarding Styles). Follow the Factory Method Pattern,
C# please
1. Consider the example in Assignment 1 (a canvas that can draw only circle and rectangle, disregarding Styles). Follow the Factory Method Pattern, draw a class diagram that include these classes: Shape, Circle, Rectangle, Canvas, as well as other classes necessary. Remember to include proper connections, and necessary attribute/method definitions in your class diagram. (10pts) 2. What is the role of the Canvas class in your design: is it part of the Factory Method Pattern, or is it something external to the pattern? Justify your reasoning. (5pts). 3. Write some necessary sketch code for the classes you defined in Q1, that is enough to demonstrate the process of "drawing a circle on a canvas". You may describe the details of methods/functions with comments (no need to write actual code). (10pts) 4. Describe a scenario where the Factory Method might become insufficient, and that Abstract Factory might be better, e.g. such as introducing new elements like the Styles of the Shapes. No need to write code or draw diagram. (5pts)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started