Welcome Guest, Not a member yet? Register   Sign In
Opting for a domain-specific approach versus data-driven design with code igniter
#7

[eluser]beemr[/eluser]
[quote author="Jay Callicott" date="1219212051"]My thought is maybe I need to map out objects in the 'domain' space using my libraries folder and then initiate models through those libraries and in the controller only interact with the libraries instead of directly with the models which is what I do now. So instead of a user model I would have a user library and initiate the user model and any other model that dealt with that problem space. My user model would be much cleaner bc I would probably only include functions there that interacted with the database. Often there are other things you're doing such as login/session management, validation, interacting with files, etc that have always felt 'awkward' in the user model.[/quote]

To bring it back to the OP, I think that's an interesting approach. Currently, I'm using the library Active Record Class Mod 0.7 to give me Rails-like relationships in my models. However, now that these relationships manage so much of what a normal CI model would perform, I find myself with very thin models and a library that contains most of my data interaction. It's not that big a problem since the Active Record Mod code is still very readable, but like you mentioned before, it feels awkward.

I might just follow your suggestion and try making a "user" library that contains "model"-type behavior for all of the models that actually make up a full "User".

So, what are the big frameworks behind domain design? It's my understanding that .NET is trying to release its own MVC pattern. Are they giving up on domain-based design? Is there an Open Source community that pushes the domain approach?


Messages In This Thread
Opting for a domain-specific approach versus data-driven design with code igniter - by El Forum - 08-20-2008, 01:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB