On Jan 9, 2007, at 8:31 AM, MB Software Solutions wrote:
> Ed -- are you incorporating something like that in Dabo (i.e., code to
> take care of those things for you)?
Yes. Our data layer consists of a cursor object, which has a backend
object that is specific to the details of the backend being used.
Code originally starts in the cursor:
self.doSomething()
...until we find a backend that does it differently. Then it is
refactored to:
self.BackendObject.doSomething()
The backend object superclass is dBackend, into which the default
behavior is placed. Each subclass (for MySQL, MS SQL, etc.) can then
override the default behavior if necessary.
Example: each backend has a different way of limiting the number of
records returned from a query. MySQL uses LIMIT at the end of the
statement; MS SQL uses TOP after the SELECT keyword, etc. If you were
to hardcode the query in your bizobj, then yes, you'd have to change
it if you switched backends. But if you used the SQL builder code in
Dabo:
bizobj.setLimit(100)
...then that gets executed at runtime into the appropriate syntax for
the current backend.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.