On Sun, Jun 24, 2012 at 9:40 AM, randian <
blo...@discussion.fastmail.fm> wrote:
> I've been trying Module::Pluggable to import a bunch of modules containing
> Rose table definitions/classes. It appears to essentially do a 'require' for
> what it loads. Unfortunately, when I try to make method calls after doing a
> Classname->new for a table gives me the following error:
>
> Can't locate object method "add_x" via package "Table"
>
> Methods for the following relationships and foreign keys were deferred and
> then never actually created in the class Table.
>
> TYPE NAME
> ---- ----
> Foreign Key a
> Relationship x
Method creation is deferred when all the things needed to make the
method aren't ready yet. For example, if a Foo has a relationship to
Bar and Bar isn't loaded yet, Foo may not yet know enough to create
the methods associated with that relationship.
By default, RDBO will automatically load related classes, so you don't
have to load them manually. But circular relationships may create a
chicken/egg situation where method creation still needs to be
deferred, if only briefly.
If your code makes it all the way through the loading process and some
methods for some relationships (or foreign keys, same deal) still
haven't been created, then something probably went wrong when loading
a related class (syntax error?) and that error got eaten up somehow
and didn't surface as an exception. Or maybe you disabled automatic
related-class loading. Or maybe there's just a bug in RDBO somewhere.
Those are my theories.
-John