I am doing part II and III now. Currently having some doubts on how to present the entity bean and DAO in my sequence diagram.
I have decided to use BMP + DAO + VO, after reading some of the earlier threads. Problem is
a) I am not sure whether I should show the entity bean (BMP) inside my sequence diagram. Should i just show DAO classes without entity bean to make it technology independent ?
b) And having 1 BMP for each entity is not coarse-grained, so i am thinking of using composite entity to make it more coarse-grained and reduce number of network calls. If i were to show BMP in seq diagram, then should I show the interaction of the composite BMP (eg. CustomerBMP interacting with CustomerDAO, CreditCardDAO and AddressDAO?)
c) if i dont show entity bean (BMP) in my seq diagram, i also should not be showing it in my class diagram, that means component diagram is the only place i should show my entity beans ?
Entity beans are created only when a client requests it. The app server will not automatically instantiate 10000 entity beans on startup. The number of entity beans living in memory depends on server resources and to a certain extent the ejb container implementation. Using instance pooling and swapping the container will be able to use fewer instances to represent a large number of underlying data records. That is the beauty of EJB technology.
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I dont think we are saying that container automatically instantiates 10000 or whatever entity beans. No thats not the point.
Customer Entity does not have transactional or sharing requirements amongst many users...Yeah sure it is an entity but it does not qualify being an entity bean. I would create an entity bean for those which require transaction mgmt and sharing across many users. Its bad practice to just map entities identified to entity beans so as to say.
I would rather design entity beans for Segment, Seats, Flights etc using a composite design because they will be shared across many users and transactional, atomicity, isolation levels all apply for this data to keep its integrity.