Alex Rivera | Logout

Fully Object Oriented framework in PHP

Asked 2009-02-11T04:04:54.797
17

I want to create a 100% object oriented framework in PHP with no procedural programming at all, and where everything is an object. Much like Java except it will be done in PHP.

Any pointers at what features this thing should have, should it use any of the existing design patterns such as MVC? How creating objects for every table in the database would be possible, and how displaying of HTML templates etc would be done?

Please don't link to an existing framework because I want to do this on my own mainly as a learning excercise. You will be downvoted for linking to an existing framework as your answer and saying 'this does what you want'.

Some features I'd like to have are:

  • Very easy CRUD page generation
  • AJAX based pagination
  • Ajax based form validation if possible, or very easy form validation
  • Sortable tables
  • Ability to edit HTML templates using PHP
Edit
Report

1 Answer

17

Now at the risk of being downvoted, whilst at the same time being someone who is developing their own framework, I feel compelled to tell you to at least get some experience using existing frameworks. It doesn't have to be a vast amount of experience maybe do some beginner tutorials for each of the popular ones.

Considering the amount of time it takes to build a good framework, taking the time to look into what you like and loathe about existing solutions will pale in comparison. You don't even need to just look at php frameworks. Rails, Django etc are all popular for a reason.

Building a framework is rewarding, but you need a clear plan and understanding of the task at hand, which is where research comes in.

Some answers to your questions:

  • Yes, it should probably use MVC as the model view controller paradigm translates well into the world of web applications.
  • For creating models from records in tables in your database, look into ORM's and the Active Record pattern. Existing implementations to research that I know of include Doctrine, more can be found by searching on here.
  • For anything AJAX related I suggest using jQuery as a starting point as it makes AJAX very easy to get up and running.
answered 2009-02-11T05:02:08.780

Your Answer