[Zope-dev] ZClass nesting/adding desperation

Jason Spisak 444@hiretechs.com
Thu, 20 Apr 2000 15:19:30 GMT


Rik,

I had the exact same problem with a recent design.  My very first design
using ZClasses when they first came out, I put all classes in the root of
my product.  This made the management interface for "Folders" tough, but
that was the only sacrifice really.  (All those messy meta_types) But I
used the "Subobjects" tab and made sure only certain objects could be added
quite nicely to my other ZClasses.  

Also the flexibility for extending this design was better that the one I
laid out using "nested" ZClasses.  It turned out that whatever level you
nested a ZClass that was it's level of creation and inheritance.  That was
very tricky to design around.

I am now back to using my first method (all ZClassses under the product).
But I recently discovered a bug that has been reported by Alexandre and a
few others.  If you don't subclass ObjectMangaer in your "Base" ZClasses,
and you create subclasses off of you own non-ObjectManager Bases, they
never show up in the management interface or any objectValues(), etc... 
Because I didn't do this, and it is bad juju to change the ZClass Base
Classes, I have started to look into creating straight Python Products.

That's my experience and I hope it helps.

All my best,






Rik Hoekstra writes:

> This subject has come up in some form or another several times on the
> mailing list and I have studied every piece of information I could lay my
> hands upon, but I can't seem to grasp this.
> 
> I have a product with a number of nested ZClasses. This is a bit
> unfortunate, but I want the Classes to only be addable from a specific
> environment and not have them cluttering the addable objects tab in all
> folders. As several people have remarked before, the contained classes do
> not show up in the Subobjects tab (from a certain point onwards Object
> Manager subclasses do not even show the tab anymore), but this can be
> overcome by calling their factory methods directly.
> 
> Now if a ZCLass is contained in another ZClass this works well. But when the
> ZCLasses are defined on the same level, or if an instance of the same ZClass
> is to be added to an existing instance, this _will_not_work_. All juggling
> with dtml-with and calling instances directly can't help this, they are
> invariably added to the nearest parent folder object.
> 
> Now this forces me to revise the design of the product, and probably that
> will solve the question and result in a better product. All the same. Is
> there any guru out there who can explain what is happening and _why_. Or is
> this a bug?
> 
> Rik
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 


Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.