Announcement Announcement Module
No announcement yet.
AbstractFactory/EJB / redesign with Spring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • AbstractFactory/EJB / redesign with Spring

    hi all,
    i have developed a J2EE application made of SLSB and EEJB, and i wanted to port this application to Spring but i have some difficulties....
    Let me try to explain a little about the architecture of my app.
    i have a component, named 'Builder', which has following methods
    set/get PreProcessor
    set/get Processor
    set/get PostProcessor
    set/get Resource1

    PreProcessor, Processor and PostProcessor are interfaces, and i have let's say 2 different implementation for each component.

    each Builder is configured via a BuilderFactory which will build a Builder and configure it with apppropriate PreProcessor/Processor/PostProcessor.
    Each Builder is configured by reading a Configurator table that is associated with an EntityBean

    So, for this table

    clientID preprocessor processor postprocessor resources
    PreProc1 Processor PostProc1 /client1/resources
    PreProc2 Processor2 PostProc1 /client2/resources

    i have a Factory that creates 2 Builders.

    When my SLSB receives a request from the client, it first identify the client, and then based on the clientID it will get from the FActory the proper builder and will continue processing.
    THis allows me to easily add new clientIDs on the fly by simply adding a row in the database (and eventually re-deploy application when i have new processors to be added).
    So, in summary whole application is configured via a Configuration table backed by an EEJB.

    I was wondering how to move this application to Spring....

    The only idea i came up with was to declare in applicationContext.xml

    - a BuilderFactory bean, which on initialization will read data from the DB and populate a set of builders depending on clientID
    - all PreProcessorBean implementations
    - a PostProcessorBean implemntations
    - a ProcessorBean implementations

    is this the right way to go?

    any comments will be welcomed

    thanks and regards