You could see DAL as a scoped ORM i.e. for specific kind of objects, these object are Table(s) containing Field(s) and the way to manipulate those objects mimics as much as possible the relational model. By no mean DAL is thin. As a matter of fact it allows extremely sophisticated thing like accessing an IMAP server with relational semantics. The connection code is one liner and you can put it anywhere you please, there is hardly the need to write any SQL by hand.
Indeed I often use the DAL as a reference to generate SQL that I need to use in places where I can't use the DAL itself... 2014-11-28 20:51 GMT+01:00 Anthony <[email protected]>: > I suppose it depends on your requirements, though note that the web2py DAL > isn't *that *"simple" -- you might find you can get pretty far with > things like virtual fields > <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Virtual-fields>, > table inheritance > <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance>, > and table methods > <https://groups.google.com/forum/#!msg/web2py/ceqq4JwkWi4/csn0kZfyPuwJ>. > > Anthony > > > On Wednesday, November 26, 2014 4:17:26 PM UTC-5, Alan Evangelista wrote: >> >> Hi. >> >> I'd like to use the domain model pattern and keep database access code >> outside models. It seems to me that using a simple database abstraction >> layer such as web2py DAL better fits to transaction script (no domain >> models or anemic domain model - models reflect tables) or active records >> (models have data, logic and data access) design patterns. It seems to me >> that using a full domain model fits better with the data mapper pattern and >> probably I should use an ORM. You agree? >> >> How you usually embed web2py HAL into your application (from an >> architecture perspective)? >> > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

