On Wed, 2005-06-29 at 19:55 +0200, Richard Wood wrote:
> Hello Simon
> 
> Thanks for replying
> 
> The creation of new rules is not an issue but I was speculating on using 
> existing rules like
> object-create-rule, set-next-rule and others.
> 
> Putting all rule logic into one isn't really very efficient and I would be 
> duplicating code...

I don't see digester as a tool with the ability to be extended via
custom rules. I see it as an extensible core that happens to be bundled
with some convenient rules. There's nothing that says that the bundled
rules are better than your own. In fact the bundled rules need to use
lots of reflection etc. because they can't make any assumptions about
the classes they are manipulating. Custom rules can be far simpler and
more efficient as they can deal with concrete classes rather than work
only via reflection.

But which approach you use is your call. 
 
> 
> > Note however that digester rules typically operate on the top object on
> > the stack. So you may find that pushing more than one of the objects you
> > create onto the stack isn't useful.
> 
> That is exactly the problem. Inside one pattern I cannot add more than one 
> object to the stack as popping only happens when the pattern ends. And not 
> the rule...
> 

Yep.

> And is it really so unusual  to set two or more parent-child connections 
> instead of only one?

Having a parent object with multiple child objects is not unusual.

But having multiple child objects created as a result of encountering a
single xml element is. I've been using digester for years and not needed
to do this. Nor have I seen anyone else on the user list trying to do
this. And I can't think of a reason why this would be useful. 

If you absolutely do need to do this, then I suggest that Digester is
not the right tool for your job.

Regards,

Simon


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

Reply via email to