Whoops … Crap. I lied. That's a cache of entity classes, not a cache of instances. Well .. That's a bummer.
Yeah, so the normalizer field then is only useful for the life of the instance, which makes it kind of stupid and broken, so you win -- it's broken.
I think that has to be rearchitected to have a cache of normalizers based on taggable entity class … or something .. Basically normalizer can't live as an ivar on that thing, because it's going to die.
Alternatively, one could make a taggableEntity INSTANCE cache. That might be the easier solution, and maybe should have been that way from the beginning. I don't recall why I made it a class cache. The only catch with making an instance cache is that if people have subclassed these, they're going to suddenly have the behavior swapped and it could introduce problems if they made assumptions about how it previously worked. In the long run, they'd probably thank you because it makes more sense …. i think ………
Sooooo Have fun with that :) It's not a big change code-wise.
ms On Oct 19, 2012, at 4:16 PM, James Cicenia < email@hidden> wrote: I tried to do this:
@SuppressWarnings("unchecked") public static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(EOEntity entity) { Class<? extends ERTaggableEntity> taggableEntityClass = ERTaggableEntity._taggableEntities.objectForKey(entity.name()); ERTaggableEntity<T> taggableEntity; if (taggableEntityClass == null) { taggableEntity = new ERTaggableEntity<T>(entity); ERTaggableEntity.setTaggableEntityForEntityNamed(taggableEntity, entity.name());
but get the following compiler error:
The method setTaggableEntityForEntityNamed(Class<? extends ERTaggableEntity<?>>, String) in the type ERTaggableEntity is not applicable for the arguments (ERTaggableEntity<T>, String)
Thanks James
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|