[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: enums, generics and other animals

adrian@jboss.org do-not-reply at jboss.com
Fri Mar 7 13:20:12 EST 2008


Why have you created a package called "enums"?

That's just stupid. Packages should be based on what they provide
not what there contents are.
Would you create a package called "classes"? :-)

e.g. The metatype project has
org.jboss.metatype.api
- annotations
- types
- values

I think a package called "annotations" is stupid as well, but it seems to be a convention. :-)

Either put the enums in the annotations package or create a package called
model or something.  This package would also contain callback interfaces referenced
(like the ScopeFactory in the metadata repository) so calling it "enums" is plain wrong.

A couple of related issues now that I look at the annotations:

1) Why do you have class names as strings in the annotations?
To be able to read the annotations at all the classloader must exist
so there's no problem with letting the users specify classes.

2) How can the Factory(Method) annotations work?

These are used at object construction. You don't know the type until
the object is constructed so how can read the annotations? :-)

I could understand it if this was somehow used to annotation a package
with what beans need constructing and how to do it.
e.g.

  | @Beans
  | ({
  |    @Bean(name="blah", class=MyBean.class),
  |    @Bean(name="blah2", factory=MyFactory.class, method="create")
  | })
  | package com.acme;
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134935#4134935

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134935



More information about the jboss-dev-forums mailing list