Results 1 to 2 of 2

Thread: Simple architectural concerns

  1. #1
    Join Date
    Dec 2006
    Posts
    108

    Default Simple architectural concerns

    Hi,

    I got some basic doubts related to architectural concerns rgding the Spring framework. I am building a product with the Spring framework as the base and this requires extensive customization at each site:

    Do these ideas sound good ?

    - Decorator pattern at the service and the DAO layers for customers to provide extensions
    - How do I achieve runtime dependency injection ? Would it be performance intensive ?

    Thanks..VJ

  2. #2
    Join Date
    Feb 2009
    Location
    Porcupine/Hollywood, FL & Parmistan via Elbonia
    Posts
    13

    Default

    Hi Vijay,

    Quote Originally Posted by vijaynairis View Post
    Hi,

    I got some basic doubts related to architectural concerns rgding the Spring framework. I am building a product with the Spring framework as the base and this requires extensive customization at each site:
    What type of customization are you referring to? What type of product are you producing? And why use the Spring framework? What exactly do you hope to get out of it?

    Quote Originally Posted by vijaynairis View Post
    Do these ideas sound good ?
    That will depend on what you are trying to achieve. Using a specific design pattern or dependency resolution might be good in some cases, and not so good in others. These are tools and principles for specific purposes, and, like all tools, they can be used right or wrong. They are not silver bullets. Again, what exactly are you trying to accomplish?

    Quote Originally Posted by vijaynairis View Post
    - Decorator pattern at the service and the DAO layers for customers to provide extensions
    1. First, what type of "service" are you referring to. By this you mean the POJOs being registered with Spring? The servlet(s) receiving the HTTP requests?

    The decorator pattern is, usually, for "adding" behavior, for extending an implementation at runtime. For example, you have a service that performs, I dunno, a database call. Then you can wrap that up with a decorator that performs logging (writes to a log the results of the db call), performance measurements (measures and logs how long the db call took), or authentication (check if the caller is authorized to execute the db call.)

    So, it is a good design (not architectural) idea for solving problems that requires adding/extending behavior at runtime.

    2. You will need some sort of DAO, DTO layer (or abstraction layer) if you plan to implement a reusable, extensible product. So it is not so much that it is a good idea, but that it is (most of the time) a necessity.

    Quote Originally Posted by vijaynairis View Post
    - How do I achieve runtime dependency injection ? Would it be performance intensive ?

    Thanks..VJ
    Ummmm, I'm not sure what you mean by this. Dependency of injection occurs at run-time, and it is simply a way to expose and decouple dependencies and configurations. If you use Spring, most likely you will use dependency injection when you wire up your POJOs. And this occurs during start up, so performance should not an issue.

    As for how do you achieve dependency injection? Well, by configuring your beans in your spring xml files and passing whatever you need to pass to their setter methods.

    I'd like to point out that these are more of design choices than architectural concerns. Sorry if if there is much else to add, but I don't really have much information in your original post to go from.

    Regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •