Re: Design methodology question



I agree with Peter, especially on the point that you should use objects to produce the blocks. Objects are much more flexible then templates and much more powerfull then simple html. You can make them smart and adaptive so that you do not have to program a lot to use them. The phpPeanuts framework is based on this principle too, combined with simple html-mode php includes for the lay-out rich parts, see http://www.phppeanuts.org/site/index_php/Pagina/26 for an explanation.

If you don't like the complexity that comes with such a framework, you can take a look at the 'composition by inclusion and callback pattern', see http://www.phppeanuts.org/site/index_php/Pagina/195 . The user interface of the unit testing tool pnt/unit that is included in the framework download is an example of the application of this pattern, it does not use framework (except for a tiny not-OO function library).

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.

Peter Fox wrote:

Following on from 's message. . .

I am about to embark on creating a mid-size web project that heavily
relies on db interactions.

Since most pages will contain recurring form elements (input text
boxes, dropdown boxes, radio buttons, submit forms, tables, etc.), I am
thinking of using blocks to insert components to each page. All
standard elements would be instances of form element classes. Calling
up these objects would generate customized html code.


Yes. Good idea.
Similar elements in similar positions with the screen zoned appropriately.
The second part is getting the data in/out of the database.
Do this by connecting screen objects to the database model.

I've done this for a few years now and what I also have as a result is a whizzo development system of objects I can stick together on a screen with a few lines of code to do both screen and db.

Drop me a line(trapped) and you can have the whole code base ready to run on mySQL.


.