1 2 3 4 5 Previous Next 63 Replies Latest reply on Nov 13, 2009 2:07 PM by pmuir Go to original post
      • 30. Re: It's not about dependency injection
        pmuir

        You're likely to have around 1 class with this volume of annotations on ;-)

        • 31. Re: It's not about dependency injection
          pmuir

          Francisco, to test compatibility between implementations, we use a TCK (Technology Compatibility Kit) (for all JCP specs). This verifies the implementation is compatible or not. However, due to the fact we are all human (well except you an Arbi who appear to be time travellers able to stretch time given how much you post ;-), not all aspects of all assertions of a spec end up getting checked.


          However, unlike the JPA TCK, we are developing the 299 TCK, so you are in luck! Not only can you examine the tests, you can also contribute a test that shows what your interpretation of the spec assertion is, and checks the particular corner case you care about. And given your obvious passion, I am expecting at least 1 test a week from now on ;-)

          • 32. Re: It's not about dependency injection
            gavin.king

            I'm guessing we will be able to roll the additional tests into the maintenance release.

            • 33. Re: It's not about dependency injection
              gavin.king

              I personally don't see how that code would be improved (judged by reference to concrete factors like maintainability and understandability, rather than by purely subjective aesthetics) by splitting it across several XML-based deployment descriptors (or DSLs).


              I also don't believe that it's typical.

              • 34. Re: It's not about dependency injection

                Pete Muir wrote on Nov 07, 2009 19:30:


                Francisco, to test compatibility between implementations, we use a TCK (Technology Compatibility Kit) (for all JCP specs). This verifies the implementation is compatible or not. However, due to the fact we are all human (well except you an Arbi who appear to be time travellers able to stretch time given how much you post ;-), not all aspects of all assertions of a spec end up getting checked.


                I knew that, but AFAIK those TCK were only available if I paid a lot of money and/or signed an NDA.



                However, unlike the JPA TCK, we are developing the 299 TCK, so you are in luck! Not only can you examine the tests, you can also contribute a test that shows what your interpretation of the spec assertion is, and checks the particular corner case you care about. And given your obvious passion, I am expecting at least 1 test a week from now on ;-)


                Whoa... so the TCK is public? whoa... again... is that correct? wow... guess I'll have no option but to... start writing tests! (I would ask why the TCK for JPA is not open, but I think it is better to leave that to rest )

                • 35. Re: It's not about dependency injection

                  Gavin King wrote on Nov 07, 2009 21:48:


                  I personally don't see how that code would be improved (judged by reference to concrete factors like maintainability and understandability, rather than by purely subjective aesthetics) by splitting it across several XML-based deployment descriptors (or DSLs).

                  I also don't believe that it's typical.


                  May I suggest... that a way to improve it... would be to remove those annotations that cause conflicts because they mean the same de facto if not de jure. I have only played with Weld in an really really extremely superficial way, so I am not sure if that is happening in Weld annotations (as it does in JPA) but if it is, I hope a test case is written to disambiguate them (and if it is not, then since Pete has left me without any options... I guess I'll have to write it)

                  • 36. Re: It's not about dependency injection
                    gavin.king

                    The CDI TCK is Red Hat's intellectual property and we decided to license it under ASL. The JPA TCK is the property of Sun (and Oracle?) and they determine the license.

                    • 37. Re: It's not about dependency injection

                      That is good news, I do not know where I got the idea that TCKs had to be private... thanks for making the JSR 299 TCK open

                      • 38. Re: It's not about dependency injection
                        deanhiller2000

                        I have to side with Francisco on this point against Gavin here(on half the story).  I have been wanting Hibernate NOT to do validation there for a while in a certain case.  On the inserts, it does NOT bother me as much BUT on the reading in of data, it kills me and has confused others(I have helped many people there).  In fact, I read one post on the hibernate forum where the person had assumed an update was being done and I had to explain hibernate validates on reads and that was his failure.


                        I really wish this check would go away myself as well, especially the check on reading in data.  the check on inserting/updating, I really don't care as much as it has not been confusing to developers as of yet.

                        • 39. Re: It's not about dependency injection
                          asookazian

                          I am now curious about this.  Hibernate validates on read?  Like when executing HQL or what?  I never experienced this using Hibernate 3 as a persistence provider for JPA 1.0.  Is this something that can be configured in the persistence.xml?


                          no, no, no; off topic, out of line...


                          and here's what CBauer would say: submit a patch!

                          • 40. Re: It's not about dependency injection
                            asookazian

                            can Weld be used with front-controller (action) based MVC frameworks like Struts 1.x or Struts 2?


                            And I just learned that Struts 2 uses Guice???  type-safe DI...



                            Along the way, you get a quick tour of some of the frameworks within the framework that is Struts 2 -- namely OpenSymphony WebWork/XWork, Guice and Dojo -- and find out how Struts 2 integrates these powerful allies to make Ajax development a pleasure.

                            http://www.javaworld.com/javaworld/jw-08-2007/jw-08-ajaxtables.html

                            • 41. Re: It's not about dependency injection
                              asookazian

                              wouldn't it be nice if one day, one release of EE X, we could create Java applications using the actual entire EE stack (e.g. JSF, JPA, EJB, Weld, etc.) and not even have to think about deviating away from the official JCP-endorsed stack and create these Frankenstein stacks?


                              Like .NET, right?  Use what's out of the box...

                              • 42. Re: It's not about dependency injection
                                asookazian

                                1) use reference impls as base unless otherwise required
                                2) use the libraries/JARs you need (or profiles, as in if you don't need web services, pick the lite profile)
                                3) select an app server (servlet container and/or EJB container)
                                4) select an IDE
                                5) select a language(s) as JVM languages are becoming popular you know
                                6) design db, UML, classes, etc. and code!


                                No more researching this AJAX framework, this DI solution, etc. unless you really need to...


                                wouldn't that be nice?

                                • 43. Re: It's not about dependency injection
                                  asookazian

                                  So in a way I'm advocating little (or no) use of Seam 3 when creating a EE 6-based application.  Why Seam now?


                                  added value: PDF, excel, remoting, conversational web services, SMPC, hmmmm... and the list goes on.


                                  Well, IMHO, as much as I like Seam 2.x, I still think Seam was/is a big hack in EE 5.  Although it was necessary to prototype ideas that made it into JSF 2.0 and CDI (among other specs?)


                                  But will we really need Seam in EE 6 apps?  Won't there be another way to avoid LIEs without Seam?  And the manual flush should have made it into JPA 2.0, no? 


                                  Well hopefully the performance issues with JSF/Seam will be alleviated fully with Seam 3...


                                  For example, how does the injection work in Weld?  Is it similar to Seam as being dynamic injection?  What if you don't want some instance variables to be injected for some methods as an optimization?  It's unnecessary overhead when they're all being refreshed all the time for all business (interface) method calls...

                                  • 44. Re: It's not about dependency injection
                                    nickarls

                                    LIE:s and other stuff can be fixed with portable extensions. I see Seam 3 more as a best of breed CDI plugins from the extensions ecosystem that have been tested and documented to work together


                                    Seam 2 was a (much needed) hack on top of EE 6 that provided stuff to be included in EE 6. Seam 3 (and others) will be a testing ground for stuff to be included in EE 7. Just like a production database always has a top 10 SQL list of statements that can be tuned, Java development will always have a top 10 annoyances that can be tuned.


                                    Injection is static (proxied)