db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armin Waibel" <ar...@code-au-lait.de>
Subject Re: First Stab at PB Tutorial Refactoring
Date Fri, 15 Aug 2003 19:53:49 GMT
Hi Brain,

> Found some time this week to start reworking on the PB Tutorial per a
> request from Armin.
>
> My thought is to focus very tightly on using the API, and pull out the
> "Intro to Mapping" part into a separate tutorial, thereby allowing the
> PB tutorial to really just look at the PB API. Additionally, I want to
> make the tutorials *not* depend on each other. Someone looking at how
> to use the ODMG API shouldn't need (though they probably should
anyway)
> need to read through the PB API tutorial to make sense of the ODMG API
> tutorial.
>
+1

> Anyway...
>
> A draft is up at http://fischer.skife.org/ojb/pb-tutorial.html
>
> This tutorial is a draft, and still needs:
> testing (code hasn't been run, but it parses correctly)
> links to advanced topics and javadocs for things referenced
> (drill-down capability)
> ???
>
> Right now tutorial1 serves as a general introduction to OJB -- this
> tutorial does not, it is just an introduction to the PB, so a new "go
> here first" document with the OJB intro given in tutorial1 needs to be
> put together.
>
+1

> As this will likely contain the first look at OJB code many people
will
> see it needs to be pretty strong, so lots of feedback is appreciated.
>
Read your (so-called - think it's near perfect) draft.
Till this day I don't realize how easy to use PB-api is ;-)

ok, two things to annotate:

- Should we use primitive types (particularly as PK) in sample class?
(e.g. foreign-key/null/0 problem)

- What about exception handling? Would exception
handling kill simplicity of the example?

public static void storeProduct(Product product)
    {
        PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
        try
       {
          broker.store(product);
        }
        catch(PersistenceBrokerException e)
        {
            broker.abortTransaction();
         }
         finally


             if(broker != null) broker.close();
         }
    }

regards,
Armin

> -Brian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message