Ò
Ò»Ê×Ê«
Hi,
( First, this is not a question about if we should use ORM. It's
question for these who are already using it. )
Usually, I only use ORM, like sqlalchemy just as an abstraction layer
of
database. So these mapping objects I wrote only contains data but not
behavior.
For example, if I have a class User, I would write another class
UserManager which with a methods like addUser, delUser. But recently
I am thinking of moving these methods to User. That sounds more OO
style.
What's your opinion? What's the benefits and problems of this style?
( First, this is not a question about if we should use ORM. It's
question for these who are already using it. )
Usually, I only use ORM, like sqlalchemy just as an abstraction layer
of
database. So these mapping objects I wrote only contains data but not
behavior.
For example, if I have a class User, I would write another class
UserManager which with a methods like addUser, delUser. But recently
I am thinking of moving these methods to User. That sounds more OO
style.
What's your opinion? What's the benefits and problems of this style?