473,383 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

OO Form Framework Seeks Assistance

I'm looking for help with project. I have written a detailed post about
it.

Please see:
http://forums.devnetwork.net/viewtopic.php?t=52753

Aug 6 '06 #1
11 1644
ol*************@gmail.com wrote:
I'm looking for help with project. I have written a detailed post about
it.

Please see:
http://forums.devnetwork.net/viewtopic.php?t=52753
Looks right you are trying to create something like struts-tags or jstl.
Am I right?

That would be interesting.
Aug 6 '06 #2
ol*************@gmail.com schrieb:
I'm looking for help with project. I have written a detailed post about
it.

Please see:
http://forums.devnetwork.net/viewtopic.php?t=52753
I assume you are aware of:
http://pear.php.net/package/HTML_QuickForm
http://pear.php.net/package/HTML_QuickForm2

If you want to add to your page a quick overview, in which aspects your
approach differs from QuickForm, this would be interesting.

--
Markus
Aug 8 '06 #3
ol*************@gmail.com wrote:
I'm looking for help with project. I have written a detailed post about
it.

Please see:
http://forums.devnetwork.net/viewtopic.php?t=52753
hmmm, interesting. But what makes it different from BlueShoes / PHPPeanuts /
PfP Studio / Prado?

C.
Aug 8 '06 #4

ol*************@gmail.com wrote:
I'm looking for help with project. I have written a detailed post about
it.

Please see:
http://forums.devnetwork.net/viewtopic.php?t=52753
To be honest, I've yet to find a good forms class that lets me do
things the way i want without to much hassle.

I've tried to design and plan my own form suite, but there are always a
couple of inherent problems I run into that are always at odds:
1) Presentation. Most forms autogenerate the html and spit it out.
Meanwhile, i have to manually set dozens of attributes for each element
of it to get it to have css classes even resembling something i can
style. The end result is I write just as much code using the API as I
would have writing raw HTML.
1a) Complex Presentations are hard to generate using a simple API. Ex:
your date object. IMO, having 3 fields they fill out is ugly, and it
can actually be faster to write mm/dd/yyyy instead of "type - click -
type -click -type", even better is having a javascript calendar, or
maybe its limited by the year, and you dont' care about the month.

The point is, that one input field can be displayed dozens of ways,
each one requiring some nuances.
1b) Label and input relations. Most forms can be divided up into a
table (not that its the best way, but for ease of explanation, think of
a grid layout). Where do the labels go? How far do they span?
Sometimes a simple [Label | Input] layout isn't conductive or feasible
space wise. Maybe I want the label on the right. Maybe I can't put
the label anywhere *but* the right. Maybe it goes above and spans
multiple rows. Maybe its not really a label, but just a header for
group of inputs. You see the problem? It gets complicated really
easily.

2) Logic: Most form classes have inadequate logic processing rules and
abilities for my tastes or circumstances. Sometimes things depend on
things depend on other things, and then those things need to change
other things or invalidate more things etc etc. the pear QuickForm
isn't so bad, but I can't stand the pear style of coding with the
isError() methods and such. PITA.

3) Tries to tie together too many things. A lot of form things i find
like to mix and match presentation, logic, and data stuff all into one.
All those should be seperate. I should be able to mix and match any
combination of them.

4) Don't use PHP5 abilities. Everything I see still uses masses of
arrays and operations on arrays of data. Objects, people, objects.
They let you do all that but you don't have to pass all that data
around or worry about indices being set or any of the inherent and
frustrating difficulties dealing with arrays. PHP doesn't need to go
creating copies of it all. You can reference that same data from other
places without using & or having to store some sort of key lookup or
implement some sort of trigger to lookup the current value and bla bla.
4a) Exceptions! Yes, I know a logic error in a form isn't the best use
of exceptions, but the concept is what i'm getting at. If there is an
error in a form I want to be able to simply get a value back and be
able to use the error to operate directly on that field. I don't want
to have to look it back up in the form then execute custom code:
foreach($err as $e) { $e->field->setErrText($e->getMsg()); } See?
Wasn't that easy? I just marked every invalid field with its specific
message.

Its a good start, but don't:
* Combine presentation with business logic.
* Combine data logic with the form. (the form does database
update/delete, etc)
* Force a specific presentation. (new Input("Label", "name") always
displays the same)
* Limit validation abilities

</rant>

Aug 9 '06 #5
Richard Levasseur wrote:
>
To be honest, I've yet to find a good forms class that lets me do
things the way i want without to much hassle.
People have tried and tried. The approach is fundamentally flawed. A
solution that's highly structural in nature simply will not work for a
problem that isn't.

Too often people equates "structured" with "superior" in programming. I
don't know if it's a prejudice they instill into students in CS. My own
education was in human languages. To me it's obvious that a language is
far a far more powerful and flexible tool than a class library. HTML is
very good at what it does, that is, describing the appearance of a web
page. PHP is also very good at what it does, gluing various
functionalities together. I don't understand why people keep insisting
on having a structural framework when the structure has questionable
benefits and imposes constraints.

/rant off

Aug 9 '06 #6
Chung Leong wrote:
Richard Levasseur wrote:
>>
To be honest, I've yet to find a good forms class that lets me do
things the way i want without to much hassle.

People have tried and tried. The approach is fundamentally flawed. A
solution that's highly structural in nature simply will not work for a
problem that isn't.
You put it better than I could. Terry Pratchett had a creature in one of
his books called a "drome". It could catch you by trapping you in a waking
dream. In the dream there would be much food, which you would eat and eat
and eat while starving to death because of course it was just a dream.
Then the drome ate you after you died.

Object-oriented forms frameworks appear to me to be the drome. They catch
you with a dream and you starve to death (lost productivity and billing)
eating the imaginary food (silver bullet of perfect programs).

All this being said, there is much value in having library routines that
handle repetitive tasks or make your code more readable. We have found
that simple routines like "hSpan($content)" make code readable, while
comprehensive routines like "hInputsFromTable($table_id)" that create a
complete set of form inputs are also very useful. But structuring it all
into a nested hierarchy of objects just adds more labor with no payoff.

Ken's $.02.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Aug 9 '06 #7
Kenneth Downs wrote:
Object-oriented forms frameworks appear to me to be the drome. They catch
you with a dream and you starve to death (lost productivity and billing)
eating the imaginary food (silver bullet of perfect programs).
It's easy to show an OO architecture in a diagram. That's where I think
people make a mental mistake. A good way to visually present
information is not necessarily a good way to create that information in
the first place. In fact, the opposite is likely to be true. It's hard
to fit a system of interacting parts into a pre-defined structure when
the rules governing the interactions are independent of those governing
the structure.

The recent fad with design pattern is another case of failing to see
the asymmetry between observation and creation. The fact that you can
identify patterns within a complex system does not mean you can
recreate a similiarly complex system using those patterns. The patterns
might give you some insights into the original system, but they are not
good starting points for a new one.
All this being said, there is much value in having library routines that
handle repetitive tasks or make your code more readable. We have found
that simple routines like "hSpan($content)" make code readable, while
comprehensive routines like "hInputsFromTable($table_id)" that create a
complete set of form inputs are also very useful. But structuring it all
into a nested hierarchy of objects just adds more labor with no payoff.
You're of course, not obliged to use those routines when they won't
work in a particular situation. They're like contractions we use when
we talk. We say "google" this and "google" that when the word actually
signifies a number of different actions: opening a web browser, typing
in www.google.com, etc. "To google" is a higher level function than "to
type", which in turn is a higher level function than "to press," so
there is a sort of hierarchy. We don't need to pay attention to it
however.

Aug 9 '06 #8
Chung Leong wrote:
Kenneth Downs wrote:
Object-oriented forms frameworks appear to me to be the drome. They catch
you with a dream and you starve to death (lost productivity and billing)
eating the imaginary food (silver bullet of perfect programs).

It's easy to show an OO architecture in a diagram. That's where I think
people make a mental mistake. A good way to visually present
information is not necessarily a good way to create that information in
the first place. In fact, the opposite is likely to be true. It's hard
to fit a system of interacting parts into a pre-defined structure when
the rules governing the interactions are independent of those governing
the structure.

The recent fad with design pattern is another case of failing to see
the asymmetry between observation and creation. The fact that you can
identify patterns within a complex system does not mean you can
recreate a similiarly complex system using those patterns. The patterns
might give you some insights into the original system, but they are not
good starting points for a new one.
All this being said, there is much value in having library routines that
handle repetitive tasks or make your code more readable. We have found
that simple routines like "hSpan($content)" make code readable, while
comprehensive routines like "hInputsFromTable($table_id)" that create a
complete set of form inputs are also very useful. But structuring it all
into a nested hierarchy of objects just adds more labor with no payoff.

You're of course, not obliged to use those routines when they won't
work in a particular situation. They're like contractions we use when
we talk. We say "google" this and "google" that when the word actually
signifies a number of different actions: opening a web browser, typing
in www.google.com, etc. "To google" is a higher level function than "to
type", which in turn is a higher level function than "to press," so
there is a sort of hierarchy. We don't need to pay attention to it
however.

$form = new Form(new GridBagLayout());
<....500 lines ...>
$form->output();

I guess thats the *other* option ;)

Aug 10 '06 #9
Richard Levasseur wrote:
>
$form = new Form(new GridBagLayout());
<....500 lines ...>
$form->output();

I guess thats the *other* option ;)
A theory of mine is that every programmer at some point of their career
has written a HTML widget class library. I know I have :-)

Aug 10 '06 #10
Chung Leong wrote:
Richard Levasseur wrote:
>>
$form = new Form(new GridBagLayout());
<....500 lines ...>
$form->output();

I guess thats the *other* option ;)

A theory of mine is that every programmer at some point of their career
has written a HTML widget class library. I know I have :-)
....before or after the database report writer?
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Aug 10 '06 #11

Kenneth Downs wrote:
Chung Leong wrote:
Richard Levasseur wrote:
>
$form = new Form(new GridBagLayout());
<....500 lines ...>
$form->output();

I guess thats the *other* option ;)
A theory of mine is that every programmer at some point of their career
has written a HTML widget class library. I know I have :-)

...before or after the database report writer?
After the widgets, but before the template library.

On another note, why the HELL doesn't php have built in HTML widgets
for the most basic things? You would think after 5 years of
development they'd have the smart idea to create a ComboBox class that
didn't suck.

Aug 11 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dalan | last post by:
I designed a dialog box with a combo to select individual vendors from a form and its related data for print ouput. Though the dialog box seems to work okay, I apparently do not have the filtering...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: RM | last post by:
Had VS .Net 2002 installed on W2k Server SP3 and supported a number of web sites. Installed VS .Net 2003 on Friday and now all web sites using .Net & MS ACCESS get this strange error upon open. ...
6
by: Al_C | last post by:
We are working with a hardware vendor that has a device that works fine on Win98SE. The code even makes sure it has the VB6 run time library. On our windows XP machine it goes belly up. (it...
9
by: G .Net | last post by:
Hi I'm soooo sorry but I've had to re-post this message again. I have no idea what has been happening but for some reason I couldn't seem to be able to see messages that I'd posted earlier. ...
7
by: therod | last post by:
I am running Windows Server 2003 SP1 and .Net Framework 1.1 I want to upgrade to .Net 2.0 and I'm pretty sure I should uninstall 1.1 first. Problem is that .NET 1.1 doesn't show up in Control...
1
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, I have a window application in VS2005. I can build and run it. But when I open a specific form with design view, the Visual Studio crashes and closes without error message! the error message...
1
by: =?Utf-8?B?c2ltb25j?= | last post by:
I want to rewrite a macro created in Excel VBA using VB.net. I created a fairly elaborate form in VBA and want to know if there is an easy way of importing it into VB.net without manually creating...
1
by: markla | last post by:
Hi, I have an Entity data model built in Entity Framework, which sources data primarily from an MS SQL 2008 database, and sources some static (data dictionary) values from code-based objects. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.