In MVC *M*odel should be abstract layer of data and hide data representation and real method access giving: universal, good described, readable and simple interface to manage this data: add, remove, get all, get one etc... methods.
Commonly I use Pylons. In the last lesson of my University of Technology our lecturer show us Django and IMHO Django Models is much more coherent then SQLAlchemy based model. Why ? In Django i "see" only class methods like save or get etc... where i don't know what is happend under the class method. This could be database, object database or simple text file or even binary file. All what I need is use the save method and when I want to move my database from, for example: mysql tables data to my own binary records data file, only what i must to do is reimplement save method, move data to my binary files and I finished (of course i should re implement other methods too). My application even doesn't know about any changes. It use save method and all is fine :) What's the "problem" with SQLAlchemy ? My class (for example User) mapped by SQLAlchemy mapper doesn't have any additional methods. My tool is meta.Session.query and my code use this. So, when I move my data to my own binary file (for example) i must re implement whole controllers code to use something new because meta doesn't have any sense. In my Pylons applications i define save, update and many other methods in User class, which give my abstract layer, hiding meta.Session inside, in methods. But this is extra job for programmer - doesn't sounds nice :| What do You think about this ? Greetings from Poland -- Jan Koprowski --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
