Re: Writing maintainable and extendable D2W rules

2009-11-14 Thread David LeBer

On 2009-11-13, at 10:16 AM, Mike Schrag wrote:

> ... Added a new "Documentation" field to RuleModeler. Stores as a key named 
> "documentation" inside the rule (which is just ignored by the runtime).

The addition of the Documentation field makes the old min and max size values 
for the split view delegate calls obsolete (so resizing the split views is 
wonky).

I've filed a jira with a patch: 


> 
> ms
> 
> On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:
> 
>> Well.. RuleModeler *is* open Source... not a big deal to extend it.
>> 
>> Cheers, Anjo
>> 
>> 
>> 
>> Am 12.11.2009 um 21:22 schrieb Mark Wardle:
>> 
>>> Not to hijack this thread but as a related issue, I wish I could add
>>> comments to my rule files It would be so helpful while learning...
>>> 
>>> Mark

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-13 Thread Mike Schrag
as it turns out i JUST committed this, so if you were looking for it earlier 
today, it wasn't there ... should be in SVN now and built within 30 mins or so.

ms

On Nov 13, 2009, at 6:10 PM, Ramsey Lee Gurley wrote:

> 
> On Nov 13, 2009, at 10:30 AM, David LeBer wrote:
> 
>> 
>> On 2009-11-13, at 10:16 AM, Mike Schrag wrote:
>> 
>>> ... Added a new "Documentation" field to RuleModeler. Stores as a key named 
>>> "documentation" inside the rule (which is just ignored by the runtime).
>> 
>> Sweet!
> 
> 
> Toootally! (^_^)
> 
> Thanks Mike!
> 
> Ramsey
> 
> 
>> 
>>> 
>>> ms
>>> 
>>> On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:
>>> 
 Well.. RuleModeler *is* open Source... not a big deal to extend it.
 
 Cheers, Anjo
 
 
 
 Am 12.11.2009 um 21:22 schrieb Mark Wardle:
 
> Not to hijack this thread but as a related issue, I wish I could add
> comments to my rule files It would be so helpful while learning...
> 
> Mark
>> 
>> ;david
>> 
>> --
>> David LeBer
>> Codeferous Software
>> 'co-def-er-ous' adj. Literally 'code-bearing'
>> site:http://codeferous.com
>> blog:http://davidleber.net
>> profile: http://www.linkedin.com/in/davidleber
>> twitter: http://twitter.com/rebeld
>> --
>> Toronto Area Cocoa / WebObjects developers group:
>> http://tacow.org
>> 
>> 
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com
>> 
>> This email sent to rgur...@mac.com
> 


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-13 Thread Ramsey Lee Gurley

On Nov 13, 2009, at 10:30 AM, David LeBer wrote:

> 
> On 2009-11-13, at 10:16 AM, Mike Schrag wrote:
> 
>> ... Added a new "Documentation" field to RuleModeler. Stores as a key named 
>> "documentation" inside the rule (which is just ignored by the runtime).
> 
> Sweet!


Toootally! (^_^)

Thanks Mike!

Ramsey


> 
>> 
>> ms
>> 
>> On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:
>> 
>>> Well.. RuleModeler *is* open Source... not a big deal to extend it.
>>> 
>>> Cheers, Anjo
>>> 
>>> 
>>> 
>>> Am 12.11.2009 um 21:22 schrieb Mark Wardle:
>>> 
 Not to hijack this thread but as a related issue, I wish I could add
 comments to my rule files It would be so helpful while learning...
 
 Mark
> 
> ;david
> 
> --
> David LeBer
> Codeferous Software
> 'co-def-er-ous' adj. Literally 'code-bearing'
> site: http://codeferous.com
> blog: http://davidleber.net
> profile:  http://www.linkedin.com/in/davidleber
> twitter:  http://twitter.com/rebeld
> --
> Toronto Area Cocoa / WebObjects developers group:
> http://tacow.org
> 
> 
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com
> 
> This email sent to rgur...@mac.com



smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Writing maintainable and extendable D2W rules

2009-11-13 Thread Mark Wardle
I despair. I pay hundreds and hundreds of pounds for this online  
WebObjects support and it still takes over three minutes for feature  
requests to be added.


Oh wait.!

On a serious note

This list is fantastic. Thank you all!

--
Dr. Mark Wardle
Specialist registrar, Neurology
(Sent from my mobile)


On 13 Nov 2009, at 15:16, Mike Schrag  wrote:

... Added a new "Documentation" field to RuleModeler. Stores as a  
key named "documentation" inside the rule (which is just ignored by  
the runtime).


ms

On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:


Well.. RuleModeler *is* open Source... not a big deal to extend it.

Cheers, Anjo



Am 12.11.2009 um 21:22 schrieb Mark Wardle:


Not to hijack this thread but as a related issue, I wish I could add
comments to my rule files It would be so helpful while  
learning...


Mark


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com

This email sent to msch...@mdimension.com



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mark 
%40wardle.org


This email sent to m...@wardle.org


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-13 Thread David LeBer

On 2009-11-13, at 10:16 AM, Mike Schrag wrote:

> ... Added a new "Documentation" field to RuleModeler. Stores as a key named 
> "documentation" inside the rule (which is just ignored by the runtime).

Sweet!

> 
> ms
> 
> On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:
> 
>> Well.. RuleModeler *is* open Source... not a big deal to extend it.
>> 
>> Cheers, Anjo
>> 
>> 
>> 
>> Am 12.11.2009 um 21:22 schrieb Mark Wardle:
>> 
>>> Not to hijack this thread but as a related issue, I wish I could add
>>> comments to my rule files It would be so helpful while learning...
>>> 
>>> Mark

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-13 Thread Mike Schrag
... Added a new "Documentation" field to RuleModeler. Stores as a key named 
"documentation" inside the rule (which is just ignored by the runtime).

ms

On Nov 12, 2009, at 4:50 PM, Anjo Krank wrote:

> Well.. RuleModeler *is* open Source... not a big deal to extend it.
> 
> Cheers, Anjo
> 
> 
> 
> Am 12.11.2009 um 21:22 schrieb Mark Wardle:
> 
>> Not to hijack this thread but as a related issue, I wish I could add
>> comments to my rule files It would be so helpful while learning...
>> 
>> Mark
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com
> 
> This email sent to msch...@mdimension.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Ramsey Lee Gurley

On Nov 12, 2009, at 3:22 PM, Mark Wardle wrote:

> Not to hijack this thread but as a related issue, I wish I could add
> comments to my rule files 

+1

If I had the time, I'd patch it myself.  I'm afraid I am more than a bit rusty 
with XCode and Obj-C.  I'd probably do more harm than good (^_^)

Ramsey

smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Anjo Krank
> convention over configuration!


You need to be totally careful with that! It's a special case of duck typing, 
so you need to be aware that eg "propertyKey like '*Name'" may be firstName or 
lastName, but also statusName which can be a selection (contrived example, but 
you should get the point).

Better annotate your model appropriately by using prototypes and the extraInfo 
first before doing anything else.

Cheers, Anjo

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Mark Wardle
I suspect my wish to comment my rule files can be traced back to using
too many specific rules rather than going for convention over
configuration!

Best wishes,

Mark

On Thursday, November 12, 2009, Anjo Krank  wrote:
> I for my part try to:
>
> - use what is already in the model:
>
>   (smartProp.type="String" && smartProp.size> 50) => use largeString
>
> - put as much stuff in the model as possible, eg, I have 
> entity.userInfo.SIZE=small|medium|large, which allows me to
>
>   (smartRel.destEnt.userInfo.SIZE='large') => componentName="Whatever"
>
> - use parentEntity.name if possible
>
> Otherwise I *mostly* group like (e=Father && (p=x || p=y)).
>
>>> P.S:  Is it possible to speak about "rule refactoring"?
>
> Sure... it's not like the fight club?!
>
> Cheers, Anjo
>
>
>
> Am 12.11.2009 um 21:22 schrieb Mark Wardle:
>
>> Not to hijack this thread but as a related issue, I wish I could add
>> comments to my rule files It would be so helpful while learning...
>>
>> Mark
>>
>> 2009/11/12 Szántai Károly :
>>> Hi,
>>>
>>> What is the best practices for writing good, _maintainable_ and extendable
>>> D2W rules? Especially in the left-hand side.
>>>
>>> What do I mean? Let's see a very simple example. Which of the following is
>>> more maintainable, more extendable?
>>>
>>> This?
>>>
>>> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'firstName'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'lastName'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'firstName'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'lastName'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'firstName'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'lastName' =>
>>> componentName = "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: entity.name = 'Father' and task = 'edit' and (propertyKey = 'firstName'
>>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>>> 100: entity.name = 'Mother' and task = 'edit' and (propertyKey = 'firstName'
>>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>>> 100: entity.name = 'Child' and task = 'edit' and (propertyKey = 'firstName'
>>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: entity.name = 'Father' and task = 'edit' and propertyKey like '*Name'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey like '*Name'
>>> => componentName = "D2WEditString"
>>> 100: entity.name = 'Child' and task = 'edit' and propertyKey like '*Name' =>
>>> componentName = "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>>> 'Child') and task = 'edit' and propertyKey = 'firstName' => componentName =
>>> "D2WEditString"
>>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>>> 'Child') and task = 'edit' and propertyKey = 'lastName' => componentName =
>>> "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>>> 'Child') and task = 'edit' and (propertyKey = 'firstName' or propertyKey =
>>> 'lastName') => componentName = "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>>> 'Child') and task = 'edit' and propertyKey like '*Name' => componentName =
>>> "D2WEditString"
>>>
>>> Or this?
>>>
>>> 100: ( > 
>>> http://lists.apple.com/mailman/options/webobjects-dev/anjo%40krank.net
>>
>> This email sent to a...@krank.net
>
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org
>
> This email sent to m...@wardle.org
>
>

-- 
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Anjo Krank
I for my part try to:

- use what is already in the model:

  (smartProp.type="String" && smartProp.size> 50) => use largeString

- put as much stuff in the model as possible, eg, I have 
entity.userInfo.SIZE=small|medium|large, which allows me to

  (smartRel.destEnt.userInfo.SIZE='large') => componentName="Whatever"

- use parentEntity.name if possible

Otherwise I *mostly* group like (e=Father && (p=x || p=y)).

>> P.S:  Is it possible to speak about "rule refactoring"?

Sure... it's not like the fight club?!

Cheers, Anjo



Am 12.11.2009 um 21:22 schrieb Mark Wardle:

> Not to hijack this thread but as a related issue, I wish I could add
> comments to my rule files It would be so helpful while learning...
> 
> Mark
> 
> 2009/11/12 Szántai Károly :
>> Hi,
>> 
>> What is the best practices for writing good, _maintainable_ and extendable
>> D2W rules? Especially in the left-hand side.
>> 
>> What do I mean? Let's see a very simple example. Which of the following is
>> more maintainable, more extendable?
>> 
>> This?
>> 
>> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'firstName'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'lastName'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'firstName'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'lastName'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'firstName'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'lastName' =>
>> componentName = "D2WEditString"
>> 
>> Or this?
>> 
>> 100: entity.name = 'Father' and task = 'edit' and (propertyKey = 'firstName'
>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>> 100: entity.name = 'Mother' and task = 'edit' and (propertyKey = 'firstName'
>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>> 100: entity.name = 'Child' and task = 'edit' and (propertyKey = 'firstName'
>> or propertyKey = 'lastName') => componentName = "D2WEditString"
>> 
>> Or this?
>> 
>> 100: entity.name = 'Father' and task = 'edit' and propertyKey like '*Name'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Mother' and task = 'edit' and propertyKey like '*Name'
>> => componentName = "D2WEditString"
>> 100: entity.name = 'Child' and task = 'edit' and propertyKey like '*Name' =>
>> componentName = "D2WEditString"
>> 
>> Or this?
>> 
>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>> 'Child') and task = 'edit' and propertyKey = 'firstName' => componentName =
>> "D2WEditString"
>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>> 'Child') and task = 'edit' and propertyKey = 'lastName' => componentName =
>> "D2WEditString"
>> 
>> Or this?
>> 
>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>> 'Child') and task = 'edit' and (propertyKey = 'firstName' or propertyKey =
>> 'lastName') => componentName = "D2WEditString"
>> 
>> Or this?
>> 
>> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
>> 'Child') and task = 'edit' and propertyKey like '*Name' => componentName =
>> "D2WEditString"
>> 
>> Or this?
>> 
>> 100: (entity.name like '*ther' or entity.name = 'Child') and task = 'edit'
>> and propertyKey like '*Name' => componentName = "D2WEditString"
>> 
>> 
>> I think all of them have pros and cons. The first one is very simple and
>> clean. The last one is very tricky and compact.
>> 
>> What do you think?
>> 
>> 
>> Thanks
>> 
>> Károly
>> 
>> P.S:  Is it possible to speak about "rule refactoring"?
>> 
>> 
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org
>> 
>> This email sent to m...@wardle.org
>> 
>> 
> 
> 
> 
> -- 
> Dr. Mark Wardle
> Specialist registrar, Neurology
> Cardiff, UK
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/anjo%40krank.net
> 
> This email sent to a...@krank.net

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Anjo Krank
Well.. RuleModeler *is* open Source... not a big deal to extend it.

Cheers, Anjo



Am 12.11.2009 um 21:22 schrieb Mark Wardle:

> Not to hijack this thread but as a related issue, I wish I could add
> comments to my rule files It would be so helpful while learning...
> 
> Mark

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Ravi Mendis
Hi,

The answer is to use Convention over Configuration. 

I've been meaning to add this to the wiki for awhile - on how to do this with 
D2W. 
Here it is:

http://wiki.objectstyle.org/confluence/display/WO/How+to+Write+D2W+Rules

Thanks,
Ravi

On 13/11/2009, at 5:04 AM, webobjects-dev-requ...@lists.apple.com wrote:

> Message: 4
> Date: Thu, 12 Nov 2009 16:19:57 +0100
> From: Sz?ntai K?roly 
> Subject: Writing maintainable and extendable D2W rules
> To: webobjects-dev@lists.apple.com
> Message-ID: <38375a17-5ff4-4ca5-bee4-3419e0964...@szantaikaroly.hu>
> Content-Type: text/plain; charset=ISO-8859-2; format=flowed; delsp=yes
> 
> Hi,
> 
> What is the best practices for writing good, _maintainable_ and  
> extendable D2W rules? Especially in the left-hand side.
> 
> What do I mean? Let's see a very simple example. Which of the  
> following is more maintainable, more extendable?
> 
> This?
> 
> 100: entity.name = 'Father' and task = 'edit' and propertyKey =  
> 'firstName' => componentName = "D2WEditString"
> 100: entity.name = 'Father' and task = 'edit' and propertyKey =  
> 'lastName' => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey =  
> 'firstName' => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey =  
> 'lastName' => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey =  
> 'firstName' => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey =  
> 'lastName' => componentName = "D2WEditString"
> 
> Or this?
> 
> 100: entity.name = 'Father' and task = 'edit' and (propertyKey =  
> 'firstName' or propertyKey = 'lastName') => componentName =  
> "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and (propertyKey =  
> 'firstName' or propertyKey = 'lastName') => componentName =  
> "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and (propertyKey =  
> 'firstName' or propertyKey = 'lastName') => componentName =  
> "D2WEditString"
> 
> Or this?
> 
> 100: entity.name = 'Father' and task = 'edit' and propertyKey like  
> '*Name' => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey like  
> '*Name' => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey like  
> '*Name' => componentName = "D2WEditString"
> 
> Or this?
> 
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
> = 'Child') and task = 'edit' and propertyKey = 'firstName' =>  
> componentName = "D2WEditString"
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
> = 'Child') and task = 'edit' and propertyKey = 'lastName' =>  
> componentName = "D2WEditString"
> 
> Or this?
> 
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
> = 'Child') and task = 'edit' and (propertyKey = 'firstName' or  
> propertyKey = 'lastName') => componentName = "D2WEditString"
> 
> Or this?
> 
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
> = 'Child') and task = 'edit' and propertyKey like '*Name' =>  
> componentName = "D2WEditString"
> 
> Or this?
> 
> 100: (entity.name like '*ther' or entity.name = 'Child') and task =  
> 'edit' and propertyKey like '*Name' => componentName = "D2WEditString"
> 
> 
> I think all of them have pros and cons. The first one is very simple  
> and clean. The last one is very tricky and compact.
> 
> What do you think?
> 
> 
> Thanks
> 
> Károly
> 
> P.S:  Is it possible to speak about "rule refactoring"?

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Writing maintainable and extendable D2W rules

2009-11-12 Thread Mark Wardle
Not to hijack this thread but as a related issue, I wish I could add
comments to my rule files It would be so helpful while learning...

Mark

2009/11/12 Szántai Károly :
> Hi,
>
> What is the best practices for writing good, _maintainable_ and extendable
> D2W rules? Especially in the left-hand side.
>
> What do I mean? Let's see a very simple example. Which of the following is
> more maintainable, more extendable?
>
> This?
>
> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'firstName'
> => componentName = "D2WEditString"
> 100: entity.name = 'Father' and task = 'edit' and propertyKey = 'lastName'
> => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'firstName'
> => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey = 'lastName'
> => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'firstName'
> => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey = 'lastName' =>
> componentName = "D2WEditString"
>
> Or this?
>
> 100: entity.name = 'Father' and task = 'edit' and (propertyKey = 'firstName'
> or propertyKey = 'lastName') => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and (propertyKey = 'firstName'
> or propertyKey = 'lastName') => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and (propertyKey = 'firstName'
> or propertyKey = 'lastName') => componentName = "D2WEditString"
>
> Or this?
>
> 100: entity.name = 'Father' and task = 'edit' and propertyKey like '*Name'
> => componentName = "D2WEditString"
> 100: entity.name = 'Mother' and task = 'edit' and propertyKey like '*Name'
> => componentName = "D2WEditString"
> 100: entity.name = 'Child' and task = 'edit' and propertyKey like '*Name' =>
> componentName = "D2WEditString"
>
> Or this?
>
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
> 'Child') and task = 'edit' and propertyKey = 'firstName' => componentName =
> "D2WEditString"
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
> 'Child') and task = 'edit' and propertyKey = 'lastName' => componentName =
> "D2WEditString"
>
> Or this?
>
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
> 'Child') and task = 'edit' and (propertyKey = 'firstName' or propertyKey =
> 'lastName') => componentName = "D2WEditString"
>
> Or this?
>
> 100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name =
> 'Child') and task = 'edit' and propertyKey like '*Name' => componentName =
> "D2WEditString"
>
> Or this?
>
> 100: (entity.name like '*ther' or entity.name = 'Child') and task = 'edit'
> and propertyKey like '*Name' => componentName = "D2WEditString"
>
>
> I think all of them have pros and cons. The first one is very simple and
> clean. The last one is very tricky and compact.
>
> What do you think?
>
>
> Thanks
>
> Károly
>
> P.S:  Is it possible to speak about "rule refactoring"?
>
>
>
>
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org
>
> This email sent to m...@wardle.org
>
>



-- 
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Writing maintainable and extendable D2W rules

2009-11-12 Thread Szántai Károly

Hi,

What is the best practices for writing good, _maintainable_ and  
extendable D2W rules? Especially in the left-hand side.


What do I mean? Let's see a very simple example. Which of the  
following is more maintainable, more extendable?


This?

100: entity.name = 'Father' and task = 'edit' and propertyKey =  
'firstName' => componentName = "D2WEditString"
100: entity.name = 'Father' and task = 'edit' and propertyKey =  
'lastName' => componentName = "D2WEditString"
100: entity.name = 'Mother' and task = 'edit' and propertyKey =  
'firstName' => componentName = "D2WEditString"
100: entity.name = 'Mother' and task = 'edit' and propertyKey =  
'lastName' => componentName = "D2WEditString"
100: entity.name = 'Child' and task = 'edit' and propertyKey =  
'firstName' => componentName = "D2WEditString"
100: entity.name = 'Child' and task = 'edit' and propertyKey =  
'lastName' => componentName = "D2WEditString"


Or this?

100: entity.name = 'Father' and task = 'edit' and (propertyKey =  
'firstName' or propertyKey = 'lastName') => componentName =  
"D2WEditString"
100: entity.name = 'Mother' and task = 'edit' and (propertyKey =  
'firstName' or propertyKey = 'lastName') => componentName =  
"D2WEditString"
100: entity.name = 'Child' and task = 'edit' and (propertyKey =  
'firstName' or propertyKey = 'lastName') => componentName =  
"D2WEditString"


Or this?

100: entity.name = 'Father' and task = 'edit' and propertyKey like  
'*Name' => componentName = "D2WEditString"
100: entity.name = 'Mother' and task = 'edit' and propertyKey like  
'*Name' => componentName = "D2WEditString"
100: entity.name = 'Child' and task = 'edit' and propertyKey like  
'*Name' => componentName = "D2WEditString"


Or this?

100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
= 'Child') and task = 'edit' and propertyKey = 'firstName' =>  
componentName = "D2WEditString"
100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
= 'Child') and task = 'edit' and propertyKey = 'lastName' =>  
componentName = "D2WEditString"


Or this?

100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
= 'Child') and task = 'edit' and (propertyKey = 'firstName' or  
propertyKey = 'lastName') => componentName = "D2WEditString"


Or this?

100: (entity.name = 'Father' or entity.name = 'Mother' or entity.name  
= 'Child') and task = 'edit' and propertyKey like '*Name' =>  
componentName = "D2WEditString"


Or this?

100: (entity.name like '*ther' or entity.name = 'Child') and task =  
'edit' and propertyKey like '*Name' => componentName = "D2WEditString"



I think all of them have pros and cons. The first one is very simple  
and clean. The last one is very tricky and compact.


What do you think?


Thanks

Károly

P.S:  Is it possible to speak about "rule refactoring"?




___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com