軟件體系

軟件體系結構第一次作業

 

作業要求: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?

              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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章