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

[eluser]Jay Callicott[/eluser]
I am in the midst of reading "foundations of programming ebook" here: http://codebetter.com/blogs/karlseguin/a...ebook.aspx by a .NET guy and wondering if I should be using a domain-specific approach.

I build a lot of applications, in 2 years I've built 30+ live state government (many big) applications using code igniter. We're moving to .NET but thus far it's been all CI.

I use the MVC approach and I have to say it's not bad. But it does get me into trouble sometimes. I built my own "poor man's rails-esque active record" tho much simpler that i use which kind of binds a model to a database table but of course I cheat bc often it will do operations across other tables, sometimes other databases and other models which can really muddle things up. It's bc often I can't make up my mind as to whether the model is a representation of that table or a more abstract model of a domain like this book talks ab. Like for example you could have a table called "users" but usually the user model involves alot more than just the interaction with that table.

I am sure there are some projects out there that do object-relational mapping in CI - I'm not really interested in that unless it's really good. I haven't been impressed by the CI 'plugin' contributions.

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.

What do you think? Am I missing something really obvious? Are other ppl doing this?


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



Theme © iAndrew 2016 - Forum software by © MyBB