You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ceki Gülcü <ce...@qos.ch> on 2002/05/14 13:58:44 UTC

Isn't Rule really an Action?


Am I the only one that finds the disctinction between Rule, Rules and
RuleSet confusing?

Isn't a Rule really an Action? Wouldn't it be better to name Rule as
Action such that a Rule becomes the association of a pattern and an
Action? One would then write Digester.addRule(String pattern, Action
action) instead of Digester.addRule(String pattern, Rule rule).

Has this been suggested before? I have checked in the mailing lists
and could not find any references. My apologies if this has been
already debated. Regards.


--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Isn't Rule really an Action?

Posted by Ceki Gülcü <ce...@qos.ch>.
At 19:31 15.05.2002 +0100, you wrote:
>On Wednesday, May 15, 2002, at 04:31 PM, Ceki Gülcü wrote:
>
>>Hi Robert,
>>
>>I am not a huge fan of name changes, quite the contrary, but this
>>particular change would be beneficial to new and old users
>>alike. Naming Rule as Action would make the documentation as well as
>>the code clearer. Just my unsolicited 2 cents.
>
>hi ceki
>
>i think that you're probably right but it's not really a change that i'd 
>consider committing myself without achieving a consensus first.

Most reasonable.

>if people think that these name changes are a good idea then we would 
>probably deprecate the old versions and inherit from the newly named 
>classes for a while.

My experience with log4j shows that alias classes are a major
headache. I would go along the route of alias classes only if
*absolutely* necessary. The case with commons-digester might
be different but for log4j it was a nightmare.


--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Isn't Rule really an Action?

Posted by robert burrell donkin <ro...@mac.com>.
On Wednesday, May 15, 2002, at 04:31 PM, Ceki Gülcü wrote:

> Hi Robert,
>
> I am not a huge fan of name changes, quite the contrary, but this
> particular change would be beneficial to new and old users
> alike. Naming Rule as Action would make the documentation as well as
> the code clearer. Just my unsolicited 2 cents.

hi ceki

i think that you're probably right but it's not really a change that i'd 
consider committing myself without achieving a consensus first.

if people think that these name changes are a good idea then we would 
probably deprecate the old versions and inherit from the newly named 
classes for a while.

do other people think that these names should be changed?

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Isn't Rule really an Action?

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi Robert,

I am not a huge fan of name changes, quite the contrary, but this
particular change would be beneficial to new and old users
alike. Naming Rule as Action would make the documentation as well as
the code clearer. Just my unsolicited 2 cents.

At 18:09 14.05.2002 +0100, robert burrell donkin wrote:
>hi ceki
>
>digester has grown rather than been designed and poor naming is one of the 
>consequences.
>
>the concepts behind them are very clear (once you understand them) but as 
>digester has grown, the word 'rule' has probably become rather over-used.
>
>'Rules' implementations are really 'Rule' pattern matchers. they know how 
>to return a set of rules that match a given pattern. this interface allows 
>different pattern matchers with different rules about pattern matching to 
>be plugged in. possible something like PatternMatcher might have been a 
>better name.
>
>i also think that you're probably right that renaming Rule into Action 
>would reduce confusion and allow the documentation to talk about a rule as 
>pattern plus an action.
>
>unfortunately, these are all core classes and so renaming them would be a 
>big step.
>
>- robert
>
>On Tuesday, May 14, 2002, at 12:58 PM, Ceki Gülcü wrote:
>
>>Am I the only one that finds the disctinction between Rule, Rules and
>>RuleSet confusing?
>>
>>Isn't a Rule really an Action? Wouldn't it be better to name Rule as
>>Action such that a Rule becomes the association of a pattern and an
>>Action? One would then write Digester.addRule(String pattern, Action
>>action) instead of Digester.addRule(String pattern, Rule rule).
>>
>>Has this been suggested before? I have checked in the mailing lists
>>and could not find any references. My apologies if this has been
>>already debated. Regards.
>>
>>
>>--
>>Ceki
>>
>>
>>--
>>To unsubscribe, 
>>e-mail:   <ma...@jakarta.apache.> org>
>>For additional commands, e-mail: 
>><ma...@jakarta.apache.> org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Isn't Rule really an Action?

Posted by robert burrell donkin <ro...@mac.com>.
hi ceki

digester has grown rather than been designed and poor naming is one of the 
consequences.

the concepts behind them are very clear (once you understand them) but as 
digester has grown, the word 'rule' has probably become rather over-used.

'Rules' implementations are really 'Rule' pattern matchers. they know how 
to return a set of rules that match a given pattern. this interface allows 
different pattern matchers with different rules about pattern matching to 
be plugged in. possible something like PatternMatcher might have been a 
better name.

i also think that you're probably right that renaming Rule into Action 
would reduce confusion and allow the documentation to talk about a rule as 
pattern plus an action.

unfortunately, these are all core classes and so renaming them would be a 
big step.

- robert

On Tuesday, May 14, 2002, at 12:58 PM, Ceki Gülcü wrote:

> Am I the only one that finds the disctinction between Rule, Rules and
> RuleSet confusing?
>
> Isn't a Rule really an Action? Wouldn't it be better to name Rule as
> Action such that a Rule becomes the association of a pattern and an
> Action? One would then write Digester.addRule(String pattern, Action
> action) instead of Digester.addRule(String pattern, Rule rule).
>
> Has this been suggested before? I have checked in the mailing lists
> and could not find any references. My apologies if this has been
> already debated. Regards.
>
>
> --
> Ceki
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>