On Wed, Jan 13, 2010 at 12:25 AM, Rickard Öberg <[email protected]> wrote:
> I'm looking at the API, and am wondering how it can be simplified, and also
> looking at the memory profile of Qi4j. One thing I noticed is that since
> Property has PropertyInfo, i.e. you can ask a property about its metadata,
> that causes an extra field in all properties, although it will be fairly
> rarely used.
Fair observation. This field will cause (Stuart, please correct me if
I'm wrong), 16 bytes 'waste'. 160kB for 10,000 property instances...
Is that a lot?
Likewise;
private ConstraintsCheck constraints;
is per PropertyInstance. Why don't we collapsed into PropertyInfo, as
I don't think it can be a "per instance" choice.
> Since the PropertyInfo is reasonably easily accessible from the various
> descriptors, I'm considering whether we should change this, so that Property
> does not extend PropertyInfo. It will then only have the get/set methods.
> This will minimize the memory footprint, and also make it easier to do the
> ComputedPropertyInstance, since no PropertyInfo needs to be provided.
Yes, ComputedProperty is a pain due to this.... and IMHO a bigger
reason to fix this.
> The main question is: is it ok if clients have to go through the
> metadescriptors rather than ask a property for the metainfo?
Could we possibly consider another option?
public interface Name extends Property<String>
{
@Structure PropertyInfo propertyInfo();
}
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev