Hello everyone! When recently approached to do some web development for a game whose code base was in dire need of a rewrite, I was determined on finding a stable, community supported framework to help speed up the process. I appreciate Cake's file organization, the way layouts are controlled, among other things, but I seem to be having a difficult time in the way I should be understanding the "M" in MVC. I've done enough web development in the past to be familiar with PHP, but more recently I've worked in object-oriented, compiled languages, as well as a few web tools built with Django. I could just give up and "do whatever works", but I feel like there's something powerful to be taken advantage of here, and I hope you guys can help!
How "magical" is the find() function? Should I be able to run one exhaustive query and get back all the nested data that I need for a View to spit out? I guess a better question would be: do you find yourself calling find() on different sets of data, packaging them together yourself (presumably with the Set class, right?) and then passing that to the view to be displayed? I have some data that is loosely related, and while I can manage to get at all of it in one query, it requires me using Containable, and dropping 5-6 associations in. That just seems quite inefficient for me. (Maybe it's not?) Coming from many OO languages, after you define a class, you instantiate it as you want to work with an individual object, play with it as you want, and throw it out. Correct me if I'm wrong, but it seems that MVC's approach is more geared towards operating on all the data at once? Or at least in the case of working with a "Model". This leads to some confusion for me, because the majority of the instances where I need to access data, it's of a small subset of the data I'm storing in the DB for my model. My webgame has "Buildings" in it, which belong to a User's "Village". Sometimes I want to grab information from a specific Building, and other times I want to grab only the specific Buildings of a Village. Is it proper to be define a function within the model that grabs or manipulates data based on this, like $this->Village->getBuildingsByVillageId()? Better yet, how do you operate on 'instances' of your data as defined by your model? I may have some more questions later, but I'll start this thread with these two (albeit loaded) questions. Any help is appreciated, thank you! - Michael -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php