Re: Work on Release 2.5: Maven Archetype and Tutorial Examples

Klaus Wuestefeld <[email protected]> Thu, 10 Jan 2013 01:24:01 -0200
Newsgroups gmane.comp.java.prevayler
Message-ID <CAMAooZFwvvQZ3LH1J7oGD4gn8E+aEm5puxtO52hfAJWF7xH1gQ@mail.gmail.com>
Karl, lets simply put the examples in Prevayler's test folder?


On Thu, Jan 10, 2013 at 1:16 AM, Klaus Wuestefeld <[email protected]
> wrote:

> Hi,
>
> Below is a conversation I had with Karl Wettin, edited for brevity.
>
> Klaus
>
>
> ----
>
> Karl Wettin: i'll try to release 2.5 this weekend
>
> Klaus Wuestefeld: Hi :)
> Klaus Wuestefeld: Whats in 2.5 again?
>
> Karl Wettin: mainly Prevalyer<PrevalenceBase> and no food taster
>
> Klaus Wuestefeld: ah nice
>
> Karl Wettin: and I'll write something on the website how to set up using
> maven. perhaps even create an archetype that creates a maven project for you
> Karl Wettin: feel free to take a look at the examples i wrote in november
> if there is somehitng you think is missing, and if you want me to move it
> to the git.
>
> Klaus Wuestefeld: maven archetype? how does that work?
>
> Karl Wettin: https://github.com/karlwettin/prevayler-examples
> Karl Wettin:
> http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
> Karl Wettin: basically you type
> mvn archetype-prevayler:generate
> Karl Wettin: and it will set up the project for you, create pom.xml, deps,
> directories, example code etc
>
> Klaus Wuestefeld: Very nice!
> Klaus Wuestefeld: Im looking at the examples again now
> Klaus Wuestefeld: Why are they in the test folder?
> https://github.com/karlwettin/prevayler-examples/tree/master/src/test
>
> Karl Wettin: because they are all demonstrated as unit tests with
> assertions etc
> Karl Wettin: but i'm listening if you have comments
>
> Klaus Wuestefeld: Yes. I think it would be nice to have the examples in
> Prevayler's git
> Klaus Wuestefeld: Comments:
> Klaus Wuestefeld: e101 is too abstract
> Klaus Wuestefeld: People might think they have to use an "Entity" class or
> extend Entity or something like that.
> Klaus Wuestefeld: "Entity" is a kind of class you would expect in an
> implementation of a persistence framework. Not in app code. That will
> confuse people.
> Klaus Wuestefeld: Please take a look at 2.2 Storing Objects, for example:
> http://community.versant.com/Documentation/Reference/db4o-7.12/java/tutorial/
> Klaus Wuestefeld: 2) Lets make all tests pass, even the ones that "fail".
> Klaus Wuestefeld: With @Test(expected = Exception.class) //Note this test
> expects an exception
> Klaus Wuestefeld: Im talking about this:
> https://github.com/karlwettin/prevayler-examples/blob/master/src/test/java/org/prevayler/examples/e102/E102Test.java
> Klaus Wuestefeld: 3) Lets mention the possible sources of non-determinism:
> using new Date(), currenTimeMillis(), nanoTime(), hashCode(), etc.
> Klaus Wuestefeld:
> https://github.com/karlwettin/prevayler-examples/blob/master/src/test/java/org/prevayler/examples/e102/README.md
> Klaus Wuestefeld: I like the way you present each caveat as a test.
> Klaus Wuestefeld: 4)
> https://github.com/karlwettin/prevayler-examples/tree/master/src/test/java/org/prevayler/examples/e103
> Klaus Wuestefeld: "that your transactions shouldn't contain actual
> business objects, only their identities."
> Klaus Wuestefeld: "identities" is bad wording. Identity (as opposed to
> equality) often refers to the object itself. Lets change it to "...only a
> way to query for them, such as an id for example."
> Klaus Wuestefeld: preavlent -> prevalent
> Klaus Wuestefeld: "an aggregate of an business object to another business
> object" is too abstract. Lets choose a metaphor and run with it: "a pilot
> to a car", "a pet to the petstore", for example.
> Klaus Wuestefeld: Please, lets change the wording from "baptism problem"
> to "initiation problem". It's  more religion-neutral.
> Klaus Wuestefeld: user is baptised -> user is initiated
>
> Karl Wettin: +1
> Karl Wettin: coming from a godless country and all, i've considered that
> before.
>
> Klaus Wuestefeld: Is that the only comment you agree on? :D
>
> Karl Wettin: hehe no, all great comments
> Karl Wettin: i'll fix them all
>
> Klaus Wuestefeld: 5) On the sources of non determinism in E102 you can
> say: "See E104 on using timestamps"
> Klaus Wuestefeld: 6) E104: Not a caveat. It is a feature to help you cope
> with caveat E102 so you dont have to put your own timestamps in your
> transactions.
> Klaus Wuestefeld: 7)
> https://github.com/karlwettin/prevayler-examples/blob/master/src/test/java/org/prevayler/examples/e103/E103Test.javaDo we need AbstractTest as a class? Cant it just be a method receiving the
> BaptismProblemUpdateEntityAggregate and UpdateEntityAggregate transaction
> objects?
> Klaus Wuestefeld: 8)
> https://github.com/karlwettin/prevayler-examples/tree/master/src/test/java/org/prevayler/examples"e102, Problems with non deterministic features in transactions."
> Klaus Wuestefeld: -> "e102, Problems with non deterministic features in
> business code."
> Klaus Wuestefeld: Same here:
> https://github.com/karlwettin/prevayler-examples/tree/master/src/test/java/org/prevayler/examples/e102
> Klaus Wuestefeld: 9) You can use assertSame()
> Klaus Wuestefeld: 10) finally: please delete E105. It is too alarming. In
> the end, it is the same as E101: You have to use transactions. Simply add a
> line of text to the description of E101: "If you change business objects
> directly without using transactions, those changes will not be persistent.
> You could, in theory, take a snapshot after every change but that is much
> slower."
> Klaus Wuestefeld: 11) Lets delete Prevayler demo1 (prime numbers) if it
> still exists.
> Klaus Wuestefeld: 12) Lets incorporate Prevayler demo2 (Bank Demo) in your
> examples project somehow, maybe in the main folder (instead of tests)
> Klaus Wuestefeld: 13) Lets remove javamatch from demo2 (Bank Demo) if we
> have not already done so.
> Klaus Wuestefeld: ------------------------------------------
> Klaus Wuestefeld: Very nice :)
>

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712

_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org