[CDBI] Worknig on Class::DBI::Relationship::IsA

[prev] [thread] [next] [Date index for 2006/02/22]

From: Peter Speltz
Subject: [CDBI] Worknig on Class::DBI::Relationship::IsA
Date: 18:04 on 22 Feb 2006
Hi all. I am co maintaining CDBI::Rel::IsA with Teejay.   I'm
currently working on it to upload a version today.  I'm a month or two
behind but expect that. I have a couple questions.

1) How to Handle  CDBI Frozen vs Not Frozen versions.  I am thinking
that *EVEN* versions numbers on IsA will be compatible with the CDBI
Frozen and Odd numbers with later releases.   ?  Is this a good or bad
idea? Any better ideas?

2) One to One vs Many to One.  -- from my DB  knowledge  I understand
IsA rels to be of either 1:1 or M:1 relationship types.  I want to
make IsA cascade delete if it is a 1:1.  I'm thinking of doing that by
passing an extra arg to the isa call:

Music::Artist->is_a(person =3D> 'Music::Person', {one_to_one     =3D> 1} );
Music::Person->is_a(species =3D> 'HomoSapien', {many_to_one =3D> 1} ); # fa=
ncy has_a

Any objections to this interface? Better ideas?

3) Are the docs still wrong on usage ? I find that I have to declare
which column to "import" from the IsA class in my classes column
lists. This may be a good thing as you have some control over methods
created for you. The docs say :

  Music::Artist->columns(All =3D> qw/artistid alias/);
  Music::Artist->is_a(person =3D> 'Music::Person'); # Music::Artist
inherits Person accessors

But my experience is this:

  Music::Artist->columns(All =3D> qw/artistid alias first_name  last_name d=
ob/);

  Music::Artist->is_a(person =3D> 'Music::Person'); # Music::Artist only
inherits Person first_name,
                                                            #
last_name, and dob

An official test will take care of what is and is not.  I would like to kno=
w --
What is desired?  Personally I am leaning toward being abel to declare
which are inherited.  It could be an arg that defaults to all.

 Also, maybe the issue is that the accessor is created but it does not
get put in the "All" colums list and it is causing me problems.
Music::Artist->is_a(person =3D> 'Music::Person', { inherit =3D>
[first_name, ...] });

Thoughts?


What I have done --
I currently have my version patched to cascade delete (i just use
has_a for M:1). I also have it patched for later CDBI releases.  I
also have the annoying debugging warns wrapped in conditionals and
defaulting to Off.

I do *not*  have official tests. I have used it pretty heaavily in
developement though without apparent issues.

So , later today   I will be uploading  .06 which will:

1) Not annoy you with warnings
2) Have Correct synopsis*
3) Have cascade delete for one_to_ones *
4) Be compatible with CDBI Frozen

And .07 all above except 4. It will be compatible with current release.

* Pending further discussion

thanks for any help.

pjs

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Worknig on Class::DBI::Relationship::IsA
Peter Speltz 18:04 on 22 Feb 2006

Re: [CDBI] Worknig on Class::DBI::Relationship::IsA
Rhesa Rozendaal 23:13 on 23 Feb 2006

Generated at 12:31 on 28 Feb 2006 by mariachi v0.52