Announcement Announcement Module
Collapse
No announcement yet.
Reusable component architecture best practices? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reusable component architecture best practices?

    I would like to have some advice on the following problem

    - I would like to build reusable components, that I could plugin into new projects. What approach should I take and how do I accomplish this using eclipse, ant, ... I guess I need a shared library somewhere because holding jar files on a componet base is just duplicating the jars. So has anyone have any experience in putting those jars / build files in a central repository (and if so dou you use ant or maven ....)?

    - When deploying them on a server I don't won't each war/ear to hold the component so I just want that I deploy my component on the server so that all my app can make use of them. Is there a good way to deploy, let's call it services, I read for example in Weblogic you have something like that?

    - When creating Spring app ctx files, should each component hold the possible configuration the component can have or belong these cfg files in the project itself and by that keeping the module more abstract

    - I have a development, a test and a production environment, each having different database and other settings. These settings I have put into properties files and depending on which env I am in, i take the correct cfg file. Is this the correct way of working or are there better ways to switch cfg between test, dev and prod? I guess I should also think of migrating to jmx because for now the props file cannot be reloaded at runtime (don't think this is possible in Spring?)

    - Not Spring related: I have also a dev, test and prod database env (and that for each product), But I'm having difficulties of keeping them synchronised when i change something i have to change all of thme. Perhaps some people can share their thoughts on how one should keep different databases, tools vs manual sql update files???

    I would be great to hear advice from people who use Spring in large applications that share common components. If you like to share other issues that come along with using reusable components, please feel free to do so

    Grtz

    M

  • #2
    I would like to build reusable components...and if so dou you use ant or maven
    Maven has better support for this than Ant.
    When creating Spring app ctx files, should each component hold the possible configuration the component can have or belong these cfg files in the project itself and by that keeping the module more abstract
    I'd keep the contexts in the component if possible.
    It avoids duplication and illustrates which services are available within the component. Obviously some things, like datasources, would be wired up by the application. See New Spring ‘alias’ tag helps achieve lightweight component oriented assembly of applications

    I have a development, a test and a production environment, each having different database and other settings. These settings I have put into properties files and depending on which env I am in, i take the correct cfg file
    That's what we do.

    Comment


    • #3
      Originally posted by katentim
      I would like to build reusable components...and if so dou you use ant or maven
      Maven has better support for this than Ant.
      There are systems for ANT that also provide this functionality. Check ivy and maven2 also has support for this functionality so that it can be used from ANT. In the newest version of ANT there also will be support.

      Comment


      • #4
        Server + jar reuse

        And what about sharing jars in the application server ... are their issues that I need to keep in mind. I leek to have something like a "deployable module".

        The issues that I can think of are for example:
        - hot deployment ... if one module needs to be updated, I propably need to stop all the application, no?
        - The context file that are in the modules that are deployed, can my application find these in the module or should they be coppied to the applications that use this module?
        - And what about keeping versions of modules? If I choose to deploy them i.e. as jars, butone application still need to use an older version of the jar ... how can this be solved?


        - is JMX + config values in the database not a better solution then having just palin old property files?

        Thanks

        Comment

        Working...
        X