Welcome Guest, Not a member yet? Register   Sign In
NTier architecture and CodeIgniter
#2

It's too early to recommend waiting on CI4 for a production project. And the Entity blog posts that you're talking about are actually geared toward CI4, though many of the same ideas will work in CI3 just fine. And, yes, I think the DAO/DTO is very similar to the Entity/Repository pattern I was describing.

Here's what I've done in the past: get Composer running on that install if you haven't already. Then either create an App namespace that points to the application folder so you can namespace your files there, or - create a new "top-level" folder named after your company, or whatever. Then you can create any class in there that's not a Controller basically, and load them using Composer's autoloading.

If you go that second route, then you probably won't be using many of the standard ways to load models, libraries, etc, but it provides lots of freedom in how you organize your application. If you put everything in that new, namespaced folder, then it actually future-proofs the application a little too, since it's much simpler to handle any client/ requests to switch to a new framework down the road, or to move to CI4, etc. All of your business logic is contained in ways that require the framework itself as little as possible.
Reply


Messages In This Thread
NTier architecture and CodeIgniter - by antony - 04-18-2017, 06:13 PM
RE: NTier architecture and CodeIgniter - by kilishan - 04-18-2017, 07:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB