php - where to put business logic in a library? -


i'm going create library consists of lot of separate classes.

i'm familiar mvc have never created pure library before.

i wonder should put business logic? kind of logic resides in controller in mvc.

should in class or in "bootstrap" file?

and should 1 file include every class, or should 1 class include classes uses?

to clarify: goal not create mvc, pure library eg. email or guestbook others can use.

thanks!

there difference in mixed terminology between framework , library:

a library collection of classes offer functionality. user of library responsible providing information necessary , instanciating these classes (you can provide higher level abstraction classes interface simple possible).

a framework collection of classes provides frame how application or part of application being built, e.g. forcing user of framework follow mvc pattern (where user has provide appropriate model, view , controller classes). leads called inversion of control (ioc) not user of framework responsible instantiating classes , providing necessary information framework asks kinds of classes implemented , (configuration) files provided.

so first on decide if want provide library of framework. framework in php uses bootstrap file.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -