mercredi 25 mars 2015

designing a dropdown generator in symfony 2 task

i have many applications suppose X and Y X and Y both have some number of dropdowns. the number can ve different The javascript implementing the dropdowns needs the dropdown data in different formats So there will be formatters for different apps and diferent dropdowns I am writing a dropdowndatagenerator in symfony2 as a task that will give app specific dropdown data.


So far thoughts: there will be a factory that will give a object depending on the type passes in command line. there will be a manager class which will called in the front controller(execute function). i will be generating the dropdowns speific to an app by calling "php generate X" In manager class i will be calling factory form objects of different formatters which is actually a bad thing. there will a base formatter class and every dropdown formatter would be extending it. like countryFormatter extends Fromatter .



in simple language :
application : dropdown1 : formatter1
: dropdown2 : formatter2

application2 : dropdown1 : formatter1
: dropdown2 : formatter2


i want such a design that 1. whenever a new application comes it can be easily added. 2. whenever a new dropdown comes in a specific application it can also be added. 3. whenever someone wants a different formatting it can also be added easily .


Aucun commentaire:

Enregistrer un commentaire