软件体系

来源:互联网 发布:图像对比软件 编辑:程序博客网 时间:2024/05/16 10:27

软件体系结构第一次作业

 

作业要求: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 classLuxeryCarInsurance

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 classLuxeryCarInsurance 

5)   Finally youneed to modify the client class FactoryMethodGUI to allow the newly addedinsurance policyLuxery 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?

              ii.         Therelationship between the existing classes and the newly added classes.

             iii.         What codehas been added to what class?

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 changed? Does this design follow the open-closedprinciple? Why?

5.     (Testing) Typical input and output fromrunning your program


0 0
原创粉丝点击