Announcement Announcement Module
No announcement yet.
Creating a proper service layer? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a proper service layer?

    So I got my hands on J2EE without EJB Great read so far!

    And am understading how to fit my existing architecture into a more enterprise J2EE architecture...

    So starting with the service layer, what do you guys recomend? It seems like spring is nice for this! Where should I look first?

    So this is what I understand and can explain...

    1- Currently I provide 5 services to my customers. These services are accessible through one servlet. The servlet locates each service pending the xml submitted in the request and a look up that is hardcoded in the servlet. Can you see the madness in this :shock:

    2- Each service has it's own database. The business logic for each service lies within the databases. So the servlet calls stored procedures from each database from the look up it did! Even a chain is not as coupled as that! :P

    3- Each service has it's own web front end support applications like: human interaction with business logic (call centers), reporting, searches etc... Those use the store procedures, so you can kinda say code is beeing reused! :?

    4- Some of the services require the business logic of the other services. But the way currently things are implemented (logic in db, db on separate servers), we have to maintain a copy of the service local to the one that needs to use it! I just had a heart attack realising this! :shock:

    So I would like to implement a nice service layer where each service can live alone in it's on server enviroment or call upon it's neighbour to run some erands for him. Depending on processing power, some services maybe be deployed on the same server or separetly. So each service must be able to access each other localy or remotly with little to no effort!

    That servlet is accessed by all our customers and canot change! I.e: the XML request the customers send to us canot change! though the way it dispatches and looks up the services will have to change. Thats is not so bad because with the new service layer, the servlet can just act as a remote client to all the services! And new cleaner interfaces such as: web services, xml rpc etc ... can be added for newer customers...

    Maybe I can host all web applications and the servlet on one cluster and deploy the services on there oen clusters and spread them evenly, pending hardware availability and processing power. I might have 1-2 services that need the most power and should be on their own clusters! The rest can be put together!


  • #2
    Ok maybe am saying to much? Help me get an asnwer from you guys! make me understand

    I guess i can ask something simpler! Where can I find good readings and samples for creating a good service layer?


    • #3
      Service layer discussion

      The recent thread about Spring management of beans created by Hibernate might be a good starting place; follow the links to the Martin Fowler material for more discussion:

      How Common to Spring Manage Beans Created By Hibernate?
      Last edited by robyn; May 19th, 2006, 05:16 AM.


      • #4
        Thats alot to swallow! :shock: lol

        I have been reading J2EE without EJB...

        I have a legacy app that is coupled beyond imagination :P

        It's a custom server application tha receives XML over HTTP, pre or about web service buz...

        Bassically I want to decouple the server app from the DBs containing all the business logic and finally decouple the business logic from the DBs.

        So i figure if I follow a simple service layer mentioned in the book or the samples, I should be ok?



        • #5
          Well-layered applications by example

          I have a similar task as part of my current project, and your approach sounds similar to the one I am taking. I have been looking at the jpetstore sample primarily; if you or anyone else has another recommended example I would be open to suggestions. It seems to strive toward the type of layering referred to in Fowler's Anemic Domain Model, quoted by dmiller in the thread I had mentioned earlier.

          Last edited by robyn; May 19th, 2006, 05:17 AM.


          • #6
            yeah am going to start with a simple service layer and go from there...

            The interesting part will be the the server (client) I mentioned before and how I can make it locate multiple services dynamically! and/or new methods for existings services!