No hard feelings dude. the system was actually built by one person, myself. Its hard to find good web developers nowadays, they are too enamored with plugins and unit testing that they don't get anything on the screen. couple that with feature creep and you end up as myself, frustrated. i dont usually reply to messages but this one slapped me in the face. as long as your app works, then you're 90% there.
best thing to do is always explain to yourself what the purpose of your controller is, if you cant explain it in a single paragraph, you may be bloating it with too much functionality. mvc should be seen and a design pattern that perpetuates the separation of concerns. ie: if you feel you need to instantiate a model in a view, then your merging concerns, if you feel you need a helper in a controller, you're merging concerns. follow the rules that have been laid out even if it seems to be more abstract and takes a little more effort. you'll end up with more portable system. database design is an art, you'll never get it 100 percent correct. just normalize as much as you can and dont be afraid to have a model with a dozen relationships. its always easier to merge data that break it apart Sent from my iPhone On Jun 6, 2012, at 6:46 PM, bs28723 <[email protected]> wrote: > Thanks John. I am familiar with the mythical man month - good stuff! > > You, Michael and Steve, got me to re-look at what I was really trying to ask. > I think my questions are really more about "really" understanding MVC and ORM > than cake. Cake is just the code that implements MVC. While I understand > what MVC is and does. I can define it, and I can write simple applications > using it. (fat model, skinny controller) - I am not confident in all my > architecture decisions and able explain all my choices. I feel like I am > still guessing, testing, and reworking things all the time. To me, there is > a big difference between good code architecture and well written code. right > now, I am trying to make sure that I am putting the code in the right spot. > It may be crappy code, but at least it is in the model or controller where it > belongs. Maybe some day I can fix the crappy code. But I want to avoid > putting great code in the wrong place and end up with a crappy system. I am > not sure that I am explaining this any better, but my knowledge gap is the > MVC architecture. The data model is probably good for now. I am sure someone > could improve it, I don't claim to be perfect, it will probably grow and > change over time anyway. But it is some of the MVC expertise that I am > looking to learn. > > An analogy that I can came up with is, that I think I am walking in terms of > MVC and Cake, and I want to start jogging or running. But maybe, I am really > still crawling and I need to keep working, and coding, and testing, and > reworking, to learn to walk, before I can run. I think I am a fast learner > and I have learned everything that I can get my hands on, but I need more. I > feel like a young Jedi wanting to learn more and more, so I can become a > Master sooner. Or maybe it is because I am 53, I have been designing > projects and the last real programming I did was on an Unix System V device > driver 20 years ago and this ORM stuff is a little Greek. Not to mention that > all these young kids are picking this up in seconds, and I just want to keep > up. LOL > > John, you should be very proud of the system you built below. I spent 5 > years doing system architecture for AT&T, helping people design architectures > like the one you describe below. For us it was standard, but a lot of people > probably don't understand the capability or the complexity behind a scalable > DB architecture with clustered servers with masters and slaves. This is a > great testament to you and your team, and to Cake that it can handle this > large project. > > Thanks again to you, Michael & Steve. I think I am going to try to learn more > about MVC and ORB. Hopefully, I can find some things to help be learn to > run, but if not, I will just keep writing coded, learning, rewriting and > learn it over time. > > Bill > > On 6/6/2012 11:41 AM, John Hardy [via CakePHP] wrote: >> >> A computer architect should just look at what cake does. >> >> It bootstraps request into and MVC architecture. It has a built in ORM, and >> some injection points to customize and manipulate data throughout the >> request. >> >> Cake is not gonna make you or break you, if your site it built shitty, it's >> not because of the framework. >> >> It can handle a large infrastructure. You've already searched, there are no >> best practices for cake, it's not needed, it's MVC, ORM etc. It's computer >> science and software engineering. >> >> My site serves over 1 Million pages a day, over 600k in videos. >> >> I have over 90 models shared between two domains ( admin and site ) >> >> Hundreds of controllers, hundreds of views. >> >> I load balance between 8 16gb nodes. >> >> My database architecture is horizontally scaled between 1 master, 3 slaves, >> 1 session server, and 1 data warehouse server. >> >> I run a cluster of two memcached servers. >> >> Do I have shitty code in my site, you're damn right I do. But its getting >> the job done, and keeping food on peoples tables. >> I can always go back with a better strategy to handle it later. but there is >> much more good code in there too. >> >> You suffer from second system effect. Read the mythical man month. it will >> help you. >> >> >> >> On Jun 6, 2012, at 8:37 AM, Steve Found wrote: >> >>> Yes, I have the eBook of this that I bought from Apress. I believe it is >>> for cake 1.3 ? >>> >>> Although well worthy of a read, I felt there was a lot of wheel >>> re-invention going on. For example, they implement their own tree handling >>> code for categories when there is already a perfectly satisfactory >>> TreeBehavior class in Cake and they did not really explain why they felt >>> the need to do this. They also concentrate a lot on the use of elements. >>> >>> To talk about the original question, the way cake works IMHO is to >>> distribute logic between all three of Behavior, Component and Helper >>> classes with behaviors extending models, Components extending controllers >>> and Helpers extending views. The best analogy I can think of for these is >>> the C++ multiple inheritance concept where functions are added to the >>> classes to give them more methods. For example a model with both Tree and >>> Containable behaviours is both of those things in addition to being a model. >>> >>> To have a concept, say for example you wanted an edit box that plugged into >>> junit's autocompletion, you may well write a plugin that contained all >>> three of behaviours, components and helpers to achieve what you want. >>> >>> Good examples of this can be found in the CakeDC github repository and I >>> think this is a good a repository as any to see good Cake coding practises. >>> >>> https://github.com/CakeDC >>> >>> Hope this is of some help, >>> >>> Steve (Ratty) >>> >>> >>> On 06/06/12 03:28, bs28723 wrote: >>>> >>>> anyone familiar with this book? >>>> >>>> Practical CakePHP Projects (Expert's Voice in Web Development) by Richard >>>> Miller, John Omokore and Kai Chan (Dec 4, 2008) >>>> >>>> >>>> or other books that provide good examples of the >>>> Fat Model, Skinny controller Concept? >>>> >>>> On Sunday, June 3, 2012 9:04:26 AM UTC-4, ibejohn818 wrote: >>>> Fat model, skinny controller. >>>> Separation of presentation and data >>>> >>>> A couple Core concepts in building a mote maintainable app. >>>> However nothing is ever 100 perfect for all situations, learn from writing >>>> your own shitty code and do not get caught in the spiral of over >>>> engineering. Keep it simple and clever. >>>> >>>> On Jun 2, 2012 11:18 AM, "bs28723" wrote: >>>> I am probably looking for something that does not exist online, but only >>>> in a few folks heads. :-) But maybe some parts of this exists. You >>>> never know unless you ask...... >>>> >>>> I am quickly learning a lot about MVC architecture and CakePHP over the >>>> last couple months. The cookbook, lots of trial and error, and this >>>> group are helping me learn - so thanks! But, I am finding myself using >>>> simple examples to learn or implement something. Then as it scales, >>>> realize that I should have done this with a helper, behavior or >>>> component. And now, I have to go back and redesign this, to do it >>>> correctly. Great that I am learning, but this is delaying my project. >>>> Sigh. >>>> >>>> So, I am looking for more advanced examples, tutorials, or best >>>> practices to "hopefully" allow me to skip over some of the basic >>>> learning curve and get right to an architecture that will support a >>>> medium to large site with lots of capabilities. >>>> >>>> Am I asking for too much? :-) >>>> Any suggestions on where to get this advanced information or education I >>>> am looking for? >>>> >>>> Thanks, >>>> bill >>>> >>>> View this message in context: Looking for MVC & CakePHP Best practice doc, >>>> examples for Med to large sites >>>> Sent from the CakePHP mailing list archive at Nabble.com. >>>> -- >>>> >>>> -- >>>> 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 >>>> [hidden email] For more options, visit this group at >>>> http://groups.google.com/group/cake-php >>> >>> >>> -- >>> 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 >>> [hidden email] For more options, visit this group at >>> http://groups.google.com/group/cake-php >> >> -- >> 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 >> [hidden email] For more options, visit this group at >> http://groups.google.com/group/cake-php >> >> >> If you reply to this email, your message will be added to the discussion >> below: >> http://cakephp.1045679.n5.nabble.com/Looking-for-MVC-CakePHP-Best-practice-doc-examples-for-Med-to-large-sites-tp5708484p5708597.html >> To start a new topic under CakePHP, email [hidden email] >> To unsubscribe from CakePHP, click here. >> NAML > > View this message in context: Re: Looking for MVC & CakePHP Best practice > doc, examples for Med to large sites > Sent from the CakePHP mailing list archive at Nabble.com. > -- > 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 > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php -- 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
