Suggestions

From: Brad Messerle (bradleyfmesserl..ahoo.com)
Date: Sun Aug 31 2003 - 23:07:16 EDT

  • Next message: Brad Messerle: "Re: Suggestions -Background text missing"

    Please read below to get up to speed on this post.

    Thanks for the reply.

    Well I am still getting a grasp on this framework. It
    is so simular to the one I used it is getting hard to
    separate the two. Which is good. The big difference
    that I am seeing is that your data context generates a
    lot of sql. This is regarding my first question. I am
    looking for a straight forward way in retreiving
    objects. Correct me if i am wrong, in Cayenne you
    create a datacontext then do your work(ie create
    update or delete objects). then commit. The framework
    i have used had an Datastore object. This guy was your
    database enviroment(connecting, connection
    pools,etc).Then they had a Transaction object. You
    could not modify a business object with out a
    transaction started. Also they had an Object called
    HomeCollection. This object was the single point of
    entry for any business object(ie generate all the
    select, update, and delete querys). So as long as the
    data store was activated(connected to the database)
    you could go to any of your business objects home
    collection and retreive data. This should be pretty
    easy since the datacontext does alot of the sql
    building need here. I guess the question i have is, is
    a data context global? In a fat client I assume I can
    hold onto a data context and then reuse it. In a
    server enviroment, what is the proper way of reuseing
    it?

    So to make a long story longer. I would like to
    implement a home collection to my business objects.
    The methods would be like...

    findById(anId)
    basicCreate()
    allInstances()

    I assume all i would have to do is tie the datacontext
    into the home objects. So the million dollar question
    is.. What would be the best way of doing this?

    I can post my play around objects when i understand
    more about the datacontext. If the community likes
    this approach, than this is the code generation I am
    was talking about.

    I am just thinking. Could we create a DataStore
    singleton object that would hold on to the
    datacontext?. That way the home objects just have to
    call the Datastore guy to get a datacontext to
    generate the required sql?

    I hope this helps and makes sense :)

    The second question can wait, for the mean time I can
    use data rows.

    Thanks
    Brad Messerle

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com



    This archive was generated by hypermail 2.0.0 : Sun Aug 31 2003 - 23:06:28 EDT