Welcome Guest, Not a member yet? Register   Sign In
Abstraction
#1

[eluser]Richard Rowe[/eluser]
I'm developing an application in CodeIgniter that requires me to interact with multiple APIs that share the same sort of functionality. I am planning to do abstraction / interface design pattern, so I can define an interface and have classes extend/implement the interface. Very similar to how the database abstraction is done.

My question is how should I implement this neatly into my CI application (folder structure, application design, etc)? I would like to give each class (each specific api) its own file to minimise the footprint of this.

Hope that made sense. Thanks in advance.
#2

[eluser]Colin Williams[/eluser]
Seems like it would either fall in the category of Model or Library. Model especially if it deals with data manipulation and retrieval.
#3

[eluser]Dam1an[/eluser]
I second that
I would go for model too (people seem to be under the impression models are just for database stuff, but its for all data manipulation)
#4

[eluser]Richard Rowe[/eluser]
Thanks for the help. Because there will be a few classes extending this interface, I'm thinking about putting them into a folder too to neaten things up (quite like how in CI they put all the classes that extend the DBA in /drivers/), in terms of folder structure any tips?

The APIs are domain reseller ones. So I'm using one for .com, .net, .org, another for .uk, another for .au and .nz, and so on.




Theme © iAndrew 2016 - Forum software by © MyBB