Re: Vertical inheritance for PyDO2.1?
Jacob Smullyan <[email protected]> Wed, 3 Aug 2005 23:04:34 -0400
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 04, 2005 at 11:48:59AM +1000, Adam Ward wrote: > Jacob, > > I would like to see PyDO 2.1 support vertical inheritance. OK. In what way? If you want a single PyDO object that actually maps to more than one table, so that selects perform a join and updates, deletes, etc., do potentially multiple operations, then it would be possible to write a facade class that delegates to various joinable table-specific PyDO objects and presents a PyDO-like api. Is this the kind of thing you have in mind? This wouldn't require any changes to pydo.PyDO itself, I believe; and wouldn't be connected at all to Python inheritance. I think a facade pattern would be the way to go; retrofitting this sort of behavior into pydo.PyDO itself seems impractical at this stage. Whether or not that is what you had in mind, it isn't a bad idea, I think, and would also a pretty general facility applicable beyond vertical inheritance relationships for creating business objects that are less closely tied to a single specific db table. You could create views in Python, in effect; you could perform distributed transactions across databases; it would (hopefully) be less work to create an object layer that is less directly tied to the database layer. Of course, you can (and probably often should) do this now; the question is, what tasks in so doing need to be automated? Mapping underlying fields to the business object's attributes is one. Generating sql for common cases, as with PyDO objects, is another, for mutations and find operations. These are, in principle, straightforward. What else would you want such an object framework to automate, and what hooks would you want it to have? And when will it be ready? :) Or have I read your mind inaccurately, and do you mean something entirely different? > Do you have any plans for other inheritance models (other than flat) for > this release? Not currently. Cheers, js PS. I am so glad that mutt leaves temp files around so promiscuously; I just now accidentally hosed my terminal as I was about to send this, but was able to rescue it out of /tmp! -- Jacob Smullyan
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC8YXCuqamFyFXXLIRAq/6AJ9I8EDYeFImP1vEAaH/hx8NRS7lwgCfaHRq 4h7PUh/D8FLr/yWE+pW9jo4= =BZie -----END PGP SIGNATURE-----