Re: Type-safe Prevayler, using generics
Klaus Wuestefeld <[email protected]>
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <CAMAooZHXc6eFfJckbf1__aOZpDqDifQTdeVvM1fSf3do4YKj2w@mail.gmail.com> |
Karl, you can do the pull if you like. Drop Skaringa rather than having multiple factories. Thanks. On Fri, Nov 4, 2011 at 1:50 PM, Karl Wettin <[email protected]> wrote: > Next week I've got clock cycles over to refactor the Factory so that there is one per serialization strategy or so in order to avoid adding dependencies on things one might not be using. It'd be nice if we where merged with this fork by then. > > So I just did a diff to see what's really been done. I'm 100% +1 for fetching from the fork and releasing as 2.6. > > I'm not sure, are you guys expecting /me/ to be committing this or what? Let me know and I'll take care of it ASAP. > > > karl > > 29 okt 2011 kl. 02.04 skrev Klaus Wuestefeld: > >> +1 >> >> On Fri, Oct 28, 2011 at 9:17 PM, Justin T. Sampson <[email protected]> wrote: >>> Nice. :) I'd done this on a branch a while ago but I think I took it too far >>> and it ended up getting really complicated. Trying again with the bare >>> minimum generics in the high-level API is a good idea. >>> By the way, generics do not eliminate any run-time casting, so there's no >>> performance benefit. The compiler generates all the same casts that you >>> would have written by hand without generics. >>> On Fri, Oct 28, 2011 at 3:54 PM, Naveen Chawla <[email protected]> >>> wrote: >>>> >>>> Small point, but by using generics, Prevayler has complete type-safety >>>> minus casting. Took me longer than expected, but I've attempted this on >>>> Prevayler source. I submitted a "fork" on the prevayler git - >>>> https://github.com/Navigateur/prevayler - I'm not very good at git, but I >>>> think that's how you want contributions submitted. Needs run time testing. >>>> Demo and test code modified to match. Summary usage: >>>> >>>> instead of >>>> Prevayler prevayler >>>> use >>>> Prevayler<MyTypeToPrevail> prevayler >>>> >>>> and instead of >>>> PrevaylerFactory prevaylerFactory >>>> use >>>> PrevaylerFactory<MyTypeToPrevail> prevaylerFactory >>>> >>>> For your custom transactions/queries: >>>> replace >>>> implements Transaction{ >>>> with >>>> implements Transaction<MyTypeToPrevail>{ >>>> >>>> and >>>> implements TransactionWithQuery{ >>>> with >>>> implements TransactionWithQuery<MyTypeToPrevail, MyTypeToReturn>{ >>>> same for Query, SureTransactionWithQuery >>>> >>>> Then, you don't do any casting from Object to prevalent type, nor from >>>> ".execute" to return type, as these arrive in native form. >>>> ("MyTypeToPrevail" is compiler-checked as implementing Serializable in all >>>> the above cases) >>>> >>>> i.e. instead of >>>> (MyTypeToPrevail)prevalentSystem >>>> you just use >>>> prevalentSystem >>>> and instead of >>>> (MyTypeToReturn)prevayler.execute(... >>>> you just use >>>> prevayler.execute(... >>>> >>>> It might even run faster due to lack of run time casting on each >>>> transaction/query, who knows (not me). Hopefully you can test, and as soon >>>> as it works immediately release it as an update, or at least an immediate >>>> parallel choice as I really want this version now but with your genuine >>>> backing. >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> The demand for IT networking professionals continues to grow, and the >>>> demand for specialized networking skills is growing even more rapidly. >>>> Take a complimentary Learning@Cisco Self-Assessment and learn >>>> about Cisco certifications, training, and career opportunities. >>>> http://p.sf.net/sfu/cisco-dev2dev >>>> _______________________________________________ >>>> To unsubscribe go to the end of this page: >>>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >>>> _______________________________________________ >>>> "Databases in Memoriam" -- http://www.prevayler.org >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Get your Android app more play: Bring it to the BlackBerry PlayBook >>> in minutes. BlackBerry App World™ now supports Android™ Apps >>> for the BlackBerry® PlayBook™. Discover just how easy and simple >>> it is! http://p.sf.net/sfu/android-dev2dev >>> >>> _______________________________________________ >>> To unsubscribe go to the end of this page: >>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >>> _______________________________________________ >>> "Databases in Memoriam" -- http://www.prevayler.org >>> >>> >> >> ------------------------------------------------------------------------------ >> Get your Android app more play: Bring it to the BlackBerry PlayBook >> in minutes. BlackBerry App World™ now supports Android™ Apps >> for the BlackBerry® PlayBook™. Discover just how easy and simple >> it is! http://p.sf.net/sfu/android-dev2dev >> _______________________________________________ >> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >> _______________________________________________ >> "Databases in Memoriam" -- http://www.prevayler.org > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion > _______________________________________________ > "Databases in Memoriam" -- http://www.prevayler.org > ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org