I am trying to understand where some of my application logic should go in my Java EE Application. I am new to Java EE and am looking at loading a lot of unstructured data from a legacy database and building a clean object model for use by my application. From my investigation I see Java EE apps have 2 components, Enterprise Bean and Web Application components. This part of my application will be responsible for loading the data, building the object model and sending messages via JMS based on the current state of the data to interested parties. The data will be updated by synchronisation with the database and from messages received via JMS from remote Java applications.
Is an EJB the correct place for this sort of functionality? How can I start the initialisation of my object model (main method Java App equivalent)? What is the best practice for creating a timed event to review the object model and send messages via JMS?
I have read a number of articles on Java EE, Glassfish, EJB's ... but still don't feel I have a clear picture of where I should be writing this functionality. Any examples I have seen of EJB tend to be around direct method calls on the beans from client applications.
At the moment I feel a Java application may do the job but we are looking at using RMI, and web clients in the future.
"if you can't beat them, join them" effort to standardize Hibernate
- Actually a model quite like Hibernate's one was originally considered for EJB 1. Unfortunately the few engineers at the time who were in favor for that lost to their pals who insisted on the Entity Beans that eventually came in EJB 1. Ironically, the first EJB 1 Entity Beans were implemented under the hood by TopLink, the project were Hibernate was the cheap open source version of (Hibernate became famous for it, but didn't invent the model, TopLink was MUCH earlier) – Extrovert