Hello guys,
I have an idea for OO restructuring of PMA. I think converting the code to
OO will help developers deal with PMA better. The PMA can be divided into
four different subparts.
They are:
1) Code that deals with Database (Create, delete, alter)
2) Code that Deals with Tables (Create, delete, alter)
3) CRUD
4) Others (User management, sync, etc)
The above four sub-parts work together to do what PMA does, but they can
also be treated independently. What i am suggesting is that the above four
subparts can be converted into 4 different core classes and they can work
together.
Each of the core classes can have different methods to provide its
functionality. Suppose we have a class 'database' for the first subpart and
if any other subpart requires to create a database, it has to simply create
an object of the database class and call its 'create' method with the
required paramaters. This will uncomplicate the code.
Each of the above mentioned subpart of PMA can be converted into a class one
by one and can be seamlessly integrated to work with other subparts as well.
This will help developers code PMA without essentially knowing the structure
of PMA. Converting the code to OO helps to create plugins for PMA. All the
developers needs to know is the class, its methods and arguments.
For example:
Suppose a system administrator is using PMA. His requirements are that every
time a new user is added into the database, a new table should be created
for the user in the database. System Administrator will want to automate his
work and he would like a plugin for PMA that can do his work.
He asks a developer to create a plugin. If the existing code is restructured
into OO code, all that a plugin developer is required to do is that every
time a new user is added to the database, a 'table' object is created and
its 'create' method is called with appropriate arguments and a table for the
new user is created.
It could be something as simple as:
$table_object = new table();
$table_object->create($username);
Think of adding the same functionality with existing PMA structure. A new
developer will have to put in a lot of time and effort to understand the
existing PMA structure to do something as simple as above which generally
discourages them. If the code is converted into OO, all the devloper will
need to know is the struucture of the core class 'table'.
My point is that PMA can be restructured as OO code, which will be very
useful for PMA developers and plugin developers as well. OO restructuring
will do a lot good to PMA and it will encourage a lot of developers to
create plugins and add functionality to PMA.
I think before ajaxifying the UI, if OO restructuring is done it will add
lot of developers to PMA, in terms of features and plugins. Once the core OO
restructuring is done, UI can be ajaxified to provide a better user
experience.
Each of the above mentioned subparts can be restructured into OO code mostly
independently and i think in the summer time at least two or max three
subparts can be restructured as OO code. I would like to know what the
developers feel about my idea.
Thank you,
Vipin Nair
nair.vipin(a)ymail.com
swvist(a)gmail.com