Re: Method Names (was: Stolen Ideas)

[prev] [thread] [next] [Date index for 2004/08/11]

From: Tony Bowden
Subject: Re: Method Names (was: Stolen Ideas)
Date: 22:14 on 11 Aug 2004
On Wed, Aug 11, 2004 at 09:20:42AM -0500, Jay Strauss wrote:
> ** Please don't take this as criticism **, just since it seems like you're
> soliciting ideas, here is mine

Of course I take it as criticism!

I just happen to see criticism as a good thing :)

> I've always been sorta curious/befuddled about the CDBI method names.
> It seems like CDBI never went with standard OO methods or standard
> SQL, instead using both and neither.

I'll blame Schwern for this. :)

They don't really bother me; probably because I've been working with
them for so long.

I'm not really a fan of a select() method. Having it automatically
integrate with AbstractSearch is a possibility, but I'm still working
out my Grand Master Plans for search :)

> find_or_create should at least be retrieve_or_create (just to stay
> internally consistent)

find_or_create does seem slightly strange, but retrieve_or_create
doesn't work for me, either as a name, or as a description of what it
does, as it doesn't take the same arguments as create(). It's closer to
search_or_create(), but that would just be wrong.

> create vs insert or new

this one I agree with. It should probably be insert(). It'll make it
much clearer that it actually triggers the SQL INSERT command
straight-away, and doesn't need an update() like a normal set does.

> set vs update

This one I think is definitely fine as it is. set() changes the values
in the object. update() issues the UPDATE to the database.

> add_trigger vs new_trigger
> or ->new("trigger","before_insert",\&before_insert_code);

I don't see what's wrong here? This just comes from Class::Trigger.
There isn't a lot of point in changing its method names, [1]

->new(trigger ...) just seems wrong.

In general I'm not a big fan of massively overloaded methods like that.

> add_constructor vs new_select or ->new("select",recent_data,qq{create_date >
> ?});

add_constructor does exactly what it says on the tin - it adds a new
constructor. new_select() just doesn't do it for me.

> Then tackle the whole using database functions like sysdate elegantly in
> CDBI :)

Syntax, people, give me syntax!

Tony

(message missing)

Method Names (was: Stolen Ideas)
Jay Strauss 14:20 on 11 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tony Bowden 22:14 on 11 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 15:04 on 12 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tony Bowden 15:54 on 12 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 15:11 on 13 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 16:35 on 14 Aug 2004

Pass a DBI Object?
Brian E. Lozier 18:22 on 14 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tim Bunce 11:54 on 18 Aug 2004

Re: Pass a DBI Object?
Branislav Zahradnik 15:04 on 18 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52