> From: Berin Loritsch [mailto:[EMAIL PROTECTED]] > > > From: Leo Sutic [mailto:[EMAIL PROTECTED]] > > > > > From: Berin Loritsch [mailto:[EMAIL PROTECTED]] > > > > > > Hmm. What we have here is a bad design. Should the > > > container make up for your poor design? Can you really get > > > away with only three instances in a pool with a web > > > environment? Honestly, there is nothing in Cocoon that does > > > what you are talking about. > > > > Yes, it is bad design. It is more than that - it is horrible design. > > > > But admit one thing: It was not difficult to see that it was > > utterly atrocious! > > > > I meant to use it to show a situation that may occur in a > > system. It will not be as clearly awful as the abomination I > > showed you, but *hidden* in the code. I can show you more > > poor architecture: > > > > public void tailRecursive (int i) { > > if (i < 100) { > > mycomp = lookup (...); > > tailRecursive (i + 1); > > } > > } > > In order for a component based system to gain all benefits of being > component based, we have to consider the "story" of the system. After > all, that is where we develop our roles. From the story that we are > trying to tell. > > The point is that you should know ahead of time, what the correct > story is. You should know how, in a certain context the components > relate to each other. That is what design is all about. As much as > possible, you should strive to make your components as threadsafe > as possible. That way you just don't have to worry about certain > things. > > Systemic problems such as your recursive and iterative lookups should > not be allowed by design.
What's wrong with this: public void do () { for (int I = 0; i < 8000; i++) { mycomp = lookup (...); info = mycomp.getIt(i); release(mycomp); info = calculate(info); print(info); } } Assumptions: mycomp.getIt() might use JDBC connection which are limited in count, and calculate() takes some time, so it is really not wise to block connection for time of the whole loop. Vadim </snip> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]