I understand basic PHP classes and inheritance, but these don't solve in a elegant way what I want. I have been reading articles and watching video trying to get to grips with more advance OOP. But for the life of me I can not seam to find a neat solution for the following project. Any advice or hints?
I have a web application that is basically a fancy inventory and inspection record. One page has a sortable datatable, pop up dialog boxes and radio buttons to alter an items status. The page has classes for
baseClass = basic page construction, sets database connection and environment values
A dataTable class
A class that generates javascript and jquery code
A class for managing status radio buttons
Classes and methods for updating the database
The problem is how to code these different class so they can be used on other pages and can be maintained/tweaked simply. At the moment the classes are called as and when needed using spl_autoload_register()
but i get stuck ideas about Singleton, Dependancy Injection, Factories.
Any advice? (I am sure its a simple question, but banging my head against the wall is hindering me)
Thanks in advance