I'm afraid I simply don't agree that the proposed syntax is better. The 99% use case for JPA is to inject a persistence unit or context via a setter method, and this is the case that needs to be optimised. Forcing users to add property elements around the JPA elements unnecessarily complicates this scenario.
You are right to say that argument and property injection is well defined by the blueprint specification, which is why the JPA Namespace Handler uses the standard runtime model to describe the injection. The namespace handler hasn't invented anything here, it simply provides a more concise specification of the standard xml. As for reducing the complexity of the NamespaceHandler code, I firmly believe that it is better to have slightly more complex code in order to reduce the complexity for every user. Regards, Tim ---------------------------------------- > Date: Wed, 10 Nov 2010 13:35:52 -0500 > Subject: Re: jpa blueprint ns handler question > From: [email protected] > To: [email protected] > > On Mon, Nov 8, 2010 at 12:27 PM, Alasdair Nottingham wrote: > > > > I was specifically referring to your comment about one form making more > > sense than another. I was pointing out that which is simpler or clearer and > > depends on what you think jpa:context means. I was not commenting on the > > relative validity of the two XML snippets. > > > > Ok. To me the question is, what fits better or is more natural from > Blueprint POV? The syntax I described fits much better with Blueprint, > it's consistent, flexible, etc. Even one of the jpa blueprint users > had the right idea in ARIES-413. > > The argument and property bean injection is well defined in the > blueprint spec and we shouldn't invent our own ways of doing the same. > The current namespace handler just does too much and if we switch to > the new syntax the code and schema will be simpler and we will have > greater flexibility. > > Jarek
