[Seaside-dev] basicNew

Keith Hodges keith_hodges at yahoo.co.uk
Tue Jan 6 23:40:45 UTC 2009


Julian Fitzell wrote:
> On Tue, Oct 7, 2008 at 1:43 AM, Julian Fitzell <jfitzell at gmail.com> wrote:
>   
>> On Sun, Oct 5, 2008 at 7:38 PM, Avi Bryant <avi at dabbledb.com> wrote:
>>     
>>> Julian, having gotten here, it's feeling awfully familiar - I'm pretty
>>> sure the original conventions for Seaside code came about from exactly
>>> the same discussion years ago, and then got lost...
>>>       
>> Yup, I'm sure you're right.
>>
>> So, assuming there are no further dissenting opinions (are there
>> any?), someone should update the developer documentation.
>>
>> And who wants to write the code critic rules? :)
>>     
>
> Ok, I wrote this up: http://www.seaside.st/community/conventions/initialization
>
> Could people take a read and see if it makes sense and accurately
> reflects what we discussed. In most cases, our code already follows
> this convention but we may want to go through at some point and
> tighten it up a bit.
>
> Julian
>   
SomeClass-i-#initializeWithWidth: wInteger height: hInteger depth:

My thoughts are that this construct is redundant, and only serves to
clutter up the instance side of the class. The user instanciating looks
to the class side and finds an initializer whose role is to supply a
"fully working instance", which it can supply.

so...

SomeClass-c-width: w height: h depth: d

self basicNew
    width: w;
    height: h;
    depth: d;
    initialize
    yourself

These specialised initialize methods are only necessary if it has been
decided that the instance variables are to have no setters.

sorry to butt in,

Keith




More information about the seaside-dev mailing list