软件体系结构第一次作业
作业要求:The following class diagramrepresents a design in factory method pattern to query the features ofdifferent types of auto insurances. See the source code for the implementationof the following class diagram.
1) First in thefollowing design, in the class hierarchy named AutoInsurance, add a class LuxeryCarInsurance
2) The class LuxeryCarInsurance hasthesame interface and methods as every class in this class hierarchy
3) You write aword description of the new insurance
4) Then youneed to add a sub class in the class hierarchy PolicyProducer to create objectof class LuxeryCarInsurance
5) Finally youneed to modify the client class FactoryMethodGUI to allow the newly addedinsurance policy Luxery Car Insurance to be displayedas other insurance policies.
Fig 1 Design of the autoinsurance information system in the factory method pattern
1. Describe your finished homework, including
i. What classeshave been added to the existing class hierarchy/strong>
ii. Therelationship between the existing classes and the newly added classes.
iii. What codehas been added to what class/strong>
etc.
2. Run the ClientGUI class and you choose “Body InjurLiability”, and then click on “show Info” button. List all the methods calledin correct order here.
3. Draw your new class diagram here
4. After you add the new class LuxeryCarInsurance,what other classes have you changedDoes this design follow the open-closedprincipleWhy/span>
5. (Testing) Typical input and output fromrunning your program
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!