[jboss-dev-forums] [Design of POJO Server] - Re: Instance annotations from Object Models

scott.stark@jboss.org do-not-reply at jboss.com
Wed Nov 7 16:39:32 EST 2007


"adrian at jboss.org" wrote : 
  | ... with something that loads into the INSTANCE mutable metadata.
  | 
  | My preference would be to make this a visitor pattern over the metadata itself,
  | e.g.
  | 
  |   | MutableMetaData mmd = deploymentUnit.getMutableMetaData();
  |   | MetaDataVisitor visitor = new MetaDataVisitor(mmd, ...);
  |   | visitor.visit(enterpriseBean);
  |   | 
  | 
  | Which is much more extensible/maintainable and OO than the current EJB3 sutff.
  | Each part of the JavaEE/JBoss metadata can decide if/where it goes in the
  | annotation view.

I see, which really just ends up replacing code like this:

  |    private void addClassAnnotation(EJBContainer container, Class<? extends Annotation> annotationClass, Annotation annotation)
  |    {
  |       log.debug("adding class annotation " + annotationClass.getName() + " to "
  |             + container + " " + annotation);
  |       container.getAnnotations()
  |             .addClassAnnotation(annotationClass, annotation);
  |    }
  | 
where container.getAnnotations() is returning the AnnotationRepository.


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

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



More information about the jboss-dev-forums mailing list