> Ok, so maybe we just have to change our mind. What you are proposing is > that commons-attributes is the de facto runtime-implementation of > attributes. It could still be pluggable but we have a very rich default > implementation derived from the XRAI effort. Did I understand this > correctly?
Yes. > My opinion on this: Sure, I could do that. One very important thing on > my agenda is timing. I think we need to focus on having a 1.0 with the > least possible functionality that is usable out during this year. Then > we would have time experimenting with the other cool features you've > been talking about. If we could agree on this I'm all for it. I proposed a timeline like this: v0.1 = abstract serialization api (like xrai) with default serialization of .ser object stream files, Attribute+DefaultAttribute classes with the simple implementation, ClassMetaData/DefaultClassMetaData, a smart ant task v0.2 = Attribute metadata: isClassLevel/getLevel/etc, hence a simple form of validation of what user entered v0.3 = CustomAttribute v0.4 = XmlAttribute v0.5 = BCEL attributes v0.1 can be out in 2 weeks, it's mostly xrai stuff refactored a bit. > > There are other methods in Attribute too, metadata of the > > attribute: int getLevel() -> a bitset of the levels the > > attribute is applicable to, method/class/field/constructor/package > > some convenience methods like: isClassLevel/isMethodLevel/etc > > > > These methods help us do validation on user's input. > > Ok, seems nice. Do we really need a bitset thingy? Doesn't just the > predicates do? Bitsets are ugly and seems so old and outdated. I had something like Class.getModifiers() in my mind. > > > Okay, you've got a point. So let's add one more > > > interface: ClassMetaData/ClassAttributes (I think > > ClassAttributes is > > > better because there's a lot of different MetaData, but we're doing > > > Attributes here). But we should really try hard to minimize the API > > > here. > > > > ClassMetaData is better, we'll add a PackageAttribute class > > too. C# also has assembly/package level attribute. This is > > quite useful, Rickard already gave us an example in his weblog. > > Hmm... ClassMetaData but PackageAttribute? Then let's name that > PackageMetaData too. Typo, I meant PackageMetaData. > One more thing. Don't we need to add a validate()-method to Attribute so > attributes can hook in and check wheather they've got all the parameters > they require and so on? This will be called runtime (when demarshalling > attributes, attribute-implementation may have changed since > compile-time) and compile-time (before marshalling attributes). Yup! A validate() method to validate the attribute after all the parameters are set. An EjbAttribute will check whether the class is a subclass of EJBObject for example. So we need to pass in some context data. I'm afraid we have to pass xdoclet's XClass or qdox' SourceClass. And if we're going to validate in runtime too then it's trickier! Let's see what we come up with in v0.2. Ara. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
