ik zou graag de topic titel veranderen. Het is namelijk veel meer als alleen gui ontiwikkeling. Het is een hele andere manier van ontwikkelen en ook voor gebruikers een andere manier om met applicatie's te werken...(o.a. Sleur en pleur gebruiken om relaties te leggen)
ff voor degene die engels kunnen lezen
Consider the example of a banking system - a perennial favourite in object textbooks. Account is clearly an object, and it is natural to think of Checking Account and Savings Account as specialized sub-classes. A conventional use-case analysis will suggest that all Accounts will need methods for depositing, withdrawing, generating statements and applying charges, amongst others. But how should the system handle a transfer of funds between accounts?
Many people argue that this functionality belongs in some kind of a process, not to either of the Account objects.
If we don't allow the addition of scripts or controllers on top of the entity objects, then another option is to implement TransferTo(Account, CurrencyValue) as a method on both the Account classes. This could then generate a dialog box wherein the user could specify the Account to be transferred to and the amount. But the Naked Objects framework doesn't support dialog boxes. It can translate a zero-parameter method into an action on the pop-up menu for that object, and realize a one-parameter method by dragging one object onto another. But it cannot translate a multi-parameter method into a user action.
The solution is to implement Transfer as a class of object in its own right. Its attributes are the two accounts, the amount to transfer, and the date/time. The methods on the two account objects then become, effectively, 'Create New Transfer', which creates a new instance of Transfer, ready populated with the 'from' account. Alternatively, the user could shortcut this by dragging one account onto the other, which returns a new Transfer object with both the 'from' and 'to' fields populated. After specifying the amount to transfer, the user then invokes the 'Execute' or 'Make it so' method on the Transfer object.
Een nieuwe manier voor het onwikkelen van bussinessapplications ofzoiets...Ik ben hier niet zo creatief in, als er een mod is die er een mooie van weet te maken...be my guest.
[
Voor 76% gewijzigd door
yrew op 20-02-2003 16:38
]