13.07.2015 Views

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

108 Creating Collaboration DiagramsenterItem(upc,quantity):POSTenterItem(upc,quantity):StoreenterItem(upc,quantity):CashierenterItem(upc,quantity):BuyItemHandleFigure 7.25: Choices of ControllersSystementerItem()endSale()makePayment()POST.........enterItem()endSale()makePayment()Figure 7.26: Allocation of system operation to a controller class¾Use-Case Controller: If use-case controller are used, then there is a different controller for each usecase. Such a controller is not a domain object; it is an artificial construct to support the system.¾Controller and the other Patterns: Poorly designed controllers classes will have low cohesion –unfocused and handling too many loosely responsibilities. Examples of poorly designed controllersinclude:– There is only a single controller class receiving ÀÁLÁ system input events, and there are many ofthem.– The controller itself performs many of the tasks necessary to fulfill the system operations, <strong>with</strong>outdelegating the work.The solutions to solve these problems include1. Add more controllers.2. Design the controller so that it is primarily delegates the fulfilment of each system operationresponsibility on to objects, rather than doing all or most of the work itself.Report No. 259, July 2002<strong>UNU</strong>/<strong>IIST</strong>, P.O. Box 3058, Macau

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!