On Mon, Apr 19, 2010 at 7:52 PM, Emmanuel Lecharny <[email protected]> wrote: > > Suggestions : > - We want to define an Interface and an Implementation. The selected name > could be : > * Attribute for the interface > * DefaultAttribute for the implementation +1 > The reason why it's named DefaultAttribute is that it's quite a common > practice (probably better than BaseAttribute, BasicAttribute or > AttributeImpl). > - We may define an AbstractAttribute class if needed hmm not sure if we really need this, users can extend the above DefaultAttribute if required, wdyt? > - We should also implement Comparable, Iterable (over values), Cloneable and > externalizable > - We may have a ImmutableAttribute class, a wrapper around a mutable > Attribute instance > - The class might be schema aware, assuming that we inject the schema into > it (either via a constructor or via an apply(Schema) method) > - The constructors could be : > DefaultAttribute() > DefaultAttribute(String id) > DefaultAttribute(String id, byte[]... values) > DefaultAttribute(String id, String... values) > DefaultAttribute(String id, Value<?>... values) that we gonna get rid of these Value classes sooner or later right so, hmm not sure if we need a constructor with it
> DefaultAttribute(String id, SchemaManager schema) > DefaultAttribute(String id, SchemaManager schema, byte[]... values) > DefaultAttribute(String id, SchemaManager schema, String... values) > DefaultAttribute(String id, SchemaManager schema, Value<?>... values) I would suggest to merge the above SchemaManager based constructors to just one DefaultAttribute(String id, SchemaManager schema) and let the users add the attributes with separate calls thanks Emmanuel Kiran Ayyagari
