David Johnson wrote the following on 2/14/2005 2:59 PM:
I love the sound of that product, but given the time contstraints I'm
not sure I can take on learning something new and get the thing in
place on time.

Oh I understand. I wasn't really suggesting to learn a new product. I just meant that if you use a simple service layer, delegate, whatever the latest design pattern word is for it, you hide how you are doing the implementation so you could use anything you want there and swap it out easily. I'll give an example towards the end.


The other thing is that while I'm using the example of country codes,
there are in fact some things that will be quite large for example a
list of 15,000 companies that all users share

that puppy has to be stored somewhere where it can be
1. accessed by everyone
2. reloaded in some way without an app restart

I still don't see why you would need to store 15,000 items in any scope. Are you actually going to create a drop down list of 15,000 items? Clearly I don't think that's user friendly. Typically you'd create a search screen to narrow down what you need.


Database lookup is fast these days. Not sure why you are worrying about storing so much in some scope where everyone can use it? If you need to get info on a company, pull the company from the DB when you need it.

I guess I'd have to know more of the business requirements. When you say they need to share 15,000 companies that sounds like you are saying you want to dump all the companies from the database into some web application's memory. I'd certainly be against that. Again, I'd have to know why you'd ever need 15,000 records stored in Java memory.

Back to the method I was talking about earlier.. you would just provide a simple helper or service class that your Struts actions could use:

//making this static for example's sake..

public class DavidService {
  public static List getRegionCodes() {
        //HERE You could do anything...
        //access DB
        //access ApplicationScope (will have to pass in request)
        //access persistence layer (iBATIS, hibernate)
        //whatever
  }
}

Now you can use that method from your Action classes and you have some seperation of code.

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to