php - What's the best technique to build scalable (extensible), maintainable, and loosely coupled software? -


i have been playing around concept of 'module' mvc frameworks implement , seems solution, , tdd, think there must more, design pattern missed (i know few), let me build applications can grow (in code) no limits.

any thoughts?

edit : thing modules can built in way application-independent, can reused.

in "facts , fallacies of software engineering," robert l. glass says:

fact 15. reuse-in-the-small well-solved problem.

fact 16. reuse-in-the-large remains unsolved problem.

fact 17. reuse-in-the-large works best in families of related systems.

in other words, can reuse modules, between applications work similarly. trying make modules versatile can resuse them in any application hard. end making modules configurable they're overly complex use, , contain lots of code handle scenarios of no use given application.

you'd better off coding custom module each application, each application needs, , no more. important language php, code loaded on each request, volume of code has significant impact on performance.

reusing more fine-grained functionality different. uses of say, logging, reasonably similar between applications no matter how different applications 1 another. why frameworks general-purpose service-style classes.


re comment @a_var:

you can make class reusable if know range of possible functionality in advance, , therefore parts need extensible. relatively easy simple class that's used in every app. mentioned example of logging. glass refers reuse-in-the-small.

but we're not talking simple classes. if try same thing complex module (think of multiple classes handle multiple screens, forms, different database schema, etc.), it's hard write code generic enough cover specific needs each application. end needing more code in generic module sum total code you'd need write separate modules each app.

also, testing becomes costly, because change make base module requires re-test all apps use , extend it.

in end, it's less work write new module each app, , can gain efficiency can employing reusable components more fine-grained.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -