Cleaning the model

To have a clean and complete model and implementation, we should:

  • Remove the create methods from AccountLocalHome, because all accounts should be either checking or savings accounts.
  • Remove the setAccountType method from the AccountLocal interface, because the type of an account cannot be changed.
  • Remove the setBalance method from the AccountLocal interface, because the balance can only be changed through deposit and withdraw transactions.

This is not necessary for our sample, but should give you ideas for design issues you should think about in a real application.

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.