[Harbour-users] Re: ORMs

Jasim A Basheer jasim.ab at gmail.com
Wed Mar 17 16:15:34 EDT 2010


On Wed, Mar 17, 2010 at 4:59 PM,  <dougf at people.net.au> wrote:
>  I agree with Teo but with one proviso and that is that the client classes
> should be largely table agnostic.  By that I mean that:
>
>  creating say an object of class Person nothing is happening at the data
> base level.  That will only happen when we choose to Write() [In my case
> write is a method that handles both insert and update but that's just a
> personal preference.]
>
>  In practice I typically only need one such class but have a Blank()
> method - possibly not the best of names since while most fields will be
> set to blank in a typical situation some fields will have default or even
> mandatory contents.  [My Blank() method is partt of the front end class.]
>
>  The front end wouldn't therefore have a TTable Class, although the back
> end might. [My current approach has a TQuery class as well as DataItem
> class amongst others but no TTable class in the back end.]
>
>  I also note that I would have multiple front end classes eg a TPersonList
> Class as well as a TPersonClass (both of which hold data) then
> "presentation layer" classes for desplaying that data (TPersonListScreen,
> TpersonViewRditScreen) as well as classes relating to acquiring input for
> those searches (eg TPersonSearchBySurname, TPersonSearchByDOB,
> TPersonSearchByKey).  That sort of evolved as being the neatest IMO but I
> understand (retrospectively) that it represents pretty much the pure OOP
> approach (not that I am a great believer in theory).
>

>  I guess that shows the remnants of the "three layer architecture" that
> Microsoft was pushing some years back.
>
If I'm not mistaken, you mean the Model-View-Controller paradigm (MVC
for short). It seems you've successfully baked your very own MVC. For
the Web, MVC has caught on like fire and I've personally found it to
be a great modular architecture.

>  Just my thoughts
>
>  Regards
>  xProgrammer
>
> _______________________________________________
> Harbour-users mailing list (attachment size limit: 40KB)
> Harbour-users at harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>


More information about the Harbour-users mailing list