[Phpmyadmin-devel] Refactoring: Displaying query results

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Fri Jun 29 09:56:07 CEST 2012


2012/6/29 Alex Marin <alex.ukf at gmail.com>:
> On Thu, Jun 28, 2012 at 11:38 PM, Dieter Adriaenssens
> <dieter.adriaenssens at gmail.com> wrote:
>> Just an idea, while reading your description of how to use the
>> transformation classes : why don't you provide a factory pattern to
>> instantiate/create the classes. Everything like checking if the include file
>> exists, including it and preparing/instantiating can be done in the factory.
>
> That sounds like a good idea.
>
>> Also consider creating an interface for every type of class (auth,
>> export/import, transformation, ...) and implement it in every derived class
>> (f.e. ExportSql, ExportXml could implement a ExportInterface)
>
> Currently, this is implemented with abstract classes (f.e. ExportSql and
> ExportXml extend ExportPlugin and so on), and those provide a similar
> functionality to the interface. I decided to use abstract classes, because
> I wanted to be able to declare some common variables and getters and
> setters for them.

Hi Alex,

Good thinking! :)
Deriving your actual classes from a common abstract class is the best
way to do this, adding an interface is optional because the necessary
public classes are probably already defined in your abstract class,
but it's a good practise to provide an interface. ;)

-- 
Kind regards,

Dieter Adriaenssens




More information about the Developers mailing list