Michael Homeijer wrote:
Hi,

My guess is that in the future there should be a contract or something for
jsp-blocks/compiled-langauge-blocks or even programming-language blocks and
the jsp-block and jsp-weblogic-block should implement this contract, right?
I think the blocks should be as concrete as possible with the least optional
dependecies.

Would it not fit the transition to Cocoon blocks more if you go with option
2?
Hmmm... the use of mock objects in fact doesn't preclude the division of the block in two, because it is still needed to compile the jsp-weblogic-block (quick answer to Sylvain: yes, I agree, mock objects are to be used, but maybe we can also atomicize dependencies?).

So the question is in fact about having blocks with optional dependencies or
divide them till these blocks are atomic in dependency.

Even as a naming rule we can do:

blockname-block
blockspecificimplname-blockname-block

So we have

jsp-block
weblogic-jsp-block

But...

Imagine I'm using weblogic, I just want jsp behaviour, so I ask for the jsp block. Instead, with the partitioning of the blocks, I would have to ask for the weblogic-jsp-block.

Now, this is a problem, because when I change server, I have to change all definitions of it, which really sucks. This is because the weblogic-jsp-block is just an implementation of the *same* thing, not something new.

It seems that if we are talking about a block the implementation of which depends on jars we don't have, we should keep those classes in the block by using mock objects in compilation.

So, after all, I'm still on option 1.

Other opinions?


HTH,
Michael
-----Original Message-----
From: Nicola Ken Barozzi
To: cocoon-dev
Sent: 1-12-2002 10:12 Subject: Blocks confusion - dependency issue


I've made a jsp block on my hd and tried to compile it, when I got six exceptions about class not found. Here's one:

C:\jbprojects\xml-apache\xml-cocoon2\build\cocoon\blocks\jsp\src\org
\apache\cocoon\components\jsp\JSPEngineImplWLS.java:157: package weblogic.servlet.internal does not exist

Eeeeck, this would be a block with a conditional compilation upon a package I don't have... do I need weblogic to compile it? Because is I don't compile the class, the block is not complete, and it's not good.

On the other hand, I can make a mock object to compile the classes, but then I have a block that has an optional dependency, and don't know how we will make the dependency resolution work with optional stuff.

So IMHO the real options are:
1) use mock objects
2) divide the block in two: jsp-block and jsp-weblogic-block

I prepend for (1), but it still doesn't satisfy me completely...
heeeelp!

--
Nicola Ken Barozzi                   [EMAIL PROTECTED]
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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

Reply via email to