Welcome Guest, Not a member yet? Register   Sign In
skinny controller or skinny model?
#9

[eluser]solvo[/eluser]
For me personally, I like to use the MVCCS idea:

Model - gets data from your database and cache. Returns raw data to the service that will handle formatting it as needed.
View - renders output given to it by a component.
Controller - serves as gatekeeper for access to pages, defines pages as a series of modular components placed within a layout.
Component - builds a discrete, functional block of a page, takes in parameters from the controller, returns html from the view.
Service - contains the business logic for a certain feature set so that numerous components or controllers do not have to duplicate the same code and logic, cutting down on redundancy and headaches when something has to change.

I've built an open-source library on top of CodeIgniter so my projects are all already set up to rock and roll this way if anyone has any interest in trying this methodology - https://github.com/xjstratedgebx/CodeByrner.

I think at the end of the day, how you do things is a lot about personal preference. I tend to work on projects as part of a team that produces production sites that involve unit testing and a whole other department that does quality assurance to ensure that what will be pushed to our production environments are sound and perform well under load. Given what we do, we need a system that is modular so that we can partition work, but where business logic is not dispersed so 3 guys aren't writing different methods to check the same conditions or get the same data. I fully recognize that this isn't always the best solution for every project however.

Guess what I'm trying to say is this is how I like to do it, but it's not THE way to do, just A way to do it, as PhilTem said above.


Messages In This Thread
skinny controller or skinny model? - by El Forum - 06-07-2012, 10:29 PM
skinny controller or skinny model? - by El Forum - 06-07-2012, 10:40 PM
skinny controller or skinny model? - by El Forum - 06-08-2012, 05:13 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 06:01 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 09:08 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 09:52 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 11:07 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 11:33 AM
skinny controller or skinny model? - by El Forum - 06-08-2012, 11:55 AM
skinny controller or skinny model? - by El Forum - 06-09-2012, 06:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB