• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Writing maintainable and extendable D2W rules
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing maintainable and extendable D2W rules


  • Subject: Re: Writing maintainable and extendable D2W rules
  • From: Ravi Mendis <email@hidden>
  • Date: Fri, 13 Nov 2009 08:49:21 +1100

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, email@hidden wrote:

Message: 4
Date: Thu, 12 Nov 2009 16:19:57 +0100
From: Sz?ntai K?roly <email@hidden>
Subject: Writing maintainable and extendable D2W rules
To: email@hidden
Message-ID: <email@hidden">email@hidden>
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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Is this a violation of the EOF commandment?
  • Next by Date: Re: new EOObjectStoreCoordinator and closing database connection afterwards
  • Previous by thread: Re: Writing maintainable and extendable D2W rules
  • Next by thread: RESTful EOAdaptor for key-value stores
  • Index(es):
    • Date
    • Thread