On Wednesday 27 April 2005 08:34, Evert|Rooftop wrote: > Hi folks, > > I'm working on a component system for php forms and all, and I'm > wondering about an issue I have. I have a few ideas on how to fix this > problem, but I would like to hear your oppinions about it. > > These are my classes: > > Component > FormElement extends Component > ComboBox extends FormElement > InteliComboBox extends ComboBox > > The problem is, I want the components to be able to work accross > different platforms (for example XHTML, WML or XUL) and there should be > an ability to add new platforms. > How would you make a template system for this? I think the different platfoms have to be mapped to different templates for each class. Then you just construct the objects taking in mind the platform you need at the moment. A simple scenario: You have an aplication that is used via mobile users (WAP for instance), regular web users (XHTML), regular users with Mozilla (XUL) - when a user comes, you detect his platform, take the template for this platform and construct the object using it. Another client comes with different platform, you apply a different template, construct the object using it, etc. Just being abstract enough - don't hardcode such templates in the classes. Automatic management of the templates will be easy using a RDBMS. > Or is there a better way? > > Thanks for your input on this, > Evert -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436
Attachment:
pgpdsxLkIYkRv.pgp
Description: PGP signature