but then, what should this broker do, actually? Maybe you are looking for a way to work with models where in some cases you are only interested in retrieving persisted data (where actually, you only need the data, let's say as an array structure), needed only for rendering that data, while in other places you actually need model class functionality, i.e., when you're modifying data in your models and want these changes to persist, like, when you want to call your models' save() method, for example.
So, when you want to render a list of news articles along with author data, it would make more sense to query this data using joins, rather then fetching authors one by one and wasting resources by instantiating model objects you don't need.
Also, maybe you want to take a look at Doctrine (http://www.doctrine-project.org).
Best regards,
Andreas
Best regards,
Andreas
没有评论:
发表评论