Entity bean design and construction best practices

In this example, we introduced a couple of best practices that we want to summarize in relation to the advanced entity bean concepts:

  • Use of local interfaces— We modeled the entity beans to be used only within the JVM from other processes, in this case, other beans. Note that this is now a requirement of our beans because of the navigability in our relationships.

  • Tailored accessor methods for many-to-many relationships— To simplify client programming, we suggest you define tailored add and remove methods to add and delete instances of m:m relationships (for example, addAccount for the Customer bean).

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.