I was going to release a demo of OsisForms today but...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

I was going to release a demo of OsisForms today but...

Post by Ollie Saunders »

...I've all all but abandoned the project instead. Are you thinking -> 8O ?

There are several reasons for this:
  • I have come to realise that what I am trying to do is, very, very, difficult. Where ever I've turned there have been endless design decisions to make. HTML is good because it provides very basic building blocks that can be combined into larger ones to complete tasks. It took me 3 rewrites before I realised I needed to do the same if I was ever going to compete. The end result is a complex API - You know like the size of MFC for Windows or any widget library. All those things are massive!
  • It would be much much better to write something that interprets XForms into HTML/CSS/JS. J2EE has one and its looks amazing. The XForms schema has been carefully worked out (years of thinking) to provide the best flexibility at the highest level of abstraction. I really should have based my project on it from the start instead of trying to do the same on my own.
  • All the time I've spent doing this has be solitary work earning me no money, I am now completely broke. I've turned down countless nights out with friends, worked through all the weekends, worked late, worked over Christmas. In addition my health is getting bad because I'm taking virtually no exercise and I'm sitting over a computer all the time....The constant push to get this done has basically seen me sign my life away to the project and I want it back!!!1
This was the project manifesto:
* Speed up the process of making forms
* Provide an powerful modularised API that gives developers a great deal of flexibility and control
* Create a comprehensive toolset capable of tackling complex input tasks
* Use JavaScript to enhance only
* Encourage code written to make use of OsisForms to be organised and reusable
* Observe web standards, accessibility, usability, security, internationalization and portability issues.
* Acknowledge the importance of good documentation
The latest version of this project I was working on was the fourth rewrite. The previous 3 were all heavily motivated by ease of use. This last one has been different because I had learnt a massive amount about writing good object oriented code (the application of patterns etc.) and the importance of flexibilty. It is only now, after 3 failed attempt and one aborted one, that I've actually got the experience and skills to do "Eh up! This is silly."

It is bitterly disappointing to work for so many mouths, I'm embarrassed to admit it may be six, and have nothing material to show for it. Every time I need a form, I'll have to mark it up manually, do all the boring validation when I know these are problems that can be greatly simplified.

It's not all bad though. One side-effect of the project it that it has forced me to up my programming abilities. I think I'm a pretty good programmer now. One that understands all the principles and will continue to hone them for years and years before I can call myself truly 'pro'.

It's not that the project is impossible or even that it was a bad idea. It is just that I need lots of people behind it, helping me make the decisions, the code itself is dead easy it's the decisions that are incredibly difficult, and to be paid! So if 3 good programmers turn to me and say "Yeah, I wanna do this!" then the project is back on, otherwise I'm dropping it.

It's funny, I think back to when I was looking for other libraries, that do what I was planning on doing in OsisForms, I couldn't find any. Even the mighty Zend promised Zend_Form and haven't delivered a thing yet. Incidentally the proposal for Zend_Form has a lot in common with OsisForms as it stands just by matter of us both arriving at the same conclusions. I did consider that there might be a reason for why nobody had done what I wanted to do, but clearly I wasn't wise enough at the time to find it.

I do feel some sense of pride: I've spent six months of my life devoted to something I believed in, undergoing pressure from my parents, continuous set backs and difficulty realisations. And yet despite all that, I carried on! I'm either a complete idiot or one determined mother <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>, or both.

If anybody does want to see the code, its on SourceForge (and has been for a week or so). Do with it, as you wish. If the project was to start up again I certainly wouldn't be scrapping that code, its all good stuff - minus some bugs and need for refactoring in select places. Perhaps after all this time I managed to write code that potentially fulfilled 30% of my requirements.

To finish, I would like thank all you guys for being around to help me out with all my coding problems. There is no way I would have got as far as I have without you. So thanks. I'm sorry if this disappoints anybody but as I've said this isn't a project one man could ever complete before the whole IT industry moves on.

Yipppeee! I'm free now!!!! :D

Peace
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Damn, I was truly looking forward to the finished version of OSISforms. Your right though, life should come before programming and I wish you the best of luck.

Take care.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

That's a bold move - I applaud you for canceling it instead of letting it simply fade into the night.

I hope this doesn't mean you'll be gone from phpdn!
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Thanks Jcart. If the community wants it, people can get together and I will be a part of it.
That's a bold move - I applaud you for canceling it instead of letting it simply fade into the night.
Well it never really existed anywhere other than my head.
I hope this doesn't mean you'll be gone from phpdn!
Certainly not, I was here a long time before I started OsisForms and I'll be here a long time after. PHP is still my business and my passion and DevNet is the best forum about.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Wow. That's a story. Seems like a very good effort though. Hope you remember the positive things the most. I do recognize things in your experience. I think it's a good decision you call it an end.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

I just thought I'd import these PMs in here:
matthijs wrote:Hi Ole,

Just wanted to let you know I have a lot of respect for what you did on Osisforms. I was following the progress a bit but was too busy to take a closer look or getting involved. It's only now that I browse through the code repository that I see how much you've already done.

But I also understand the difficulties you described in your forum post and the reason why you decided to abandon the project. Or at least not continue on your own.

Well, the reason I write is that I think it would be nice if more would come out of this. The work you've done is not wasted, you've learned a lot in the process. As a real Zen master would say, it's not the destination but the road that leads to it.

There are at least a couple of options. Having a group of people willing to develop the code further would be nice. However, as you discovered yourself maybe a generic solution is just not feasible. Maybe a more loose, component-like approach is better. (I would be willing to help, but my time and skills are limited so I certainly can't pull the project)

But if that's not going to happen, maybe it would be nice to learn more about your experiences developing this. Have you written down things? What were your main problems and hurdles? What decisions did you have to make? I think it would be very useful for many of us to learn from your experiences, successes and mistakes.

Of course I don't expect anything from you, maybe you are so done with this that anything is too much. I would understand that. I can also try and track back your forum posts concerning osisforms.

But if you would feel like it at some time, please let me know.

This is a pm but I wouldn't mind posting this on the forum as well, in case anyone else wants to have his say. But that's up to you.

matthijs
I wrote:
Just wanted to let you know I have a lot of respect for what you did on Osisforms. I was following the progress a bit but was too busy to take a closer look or getting involved. It's only now that I browse through the code repository that I see how much you've already done.
Thanks :)
Well, the reason I write is that I think it would be nice if more would come out of this.
Yes absolutely.
The work you've done is not wasted, you've learned a lot in the process. As a real Zen master would say, it's not the destination but the road that leads to it.
I agree again. The project was born for a couple of reasons
  • So I would become a better programmer
  • So I would have something to show to people prooving how good I was
  • For the library to exist and do what it was supposed to
In that sense I achieved a third or maybe half of what I set out to do.
There are at least a couple of options. Having a group of people willing to develop the code further would be nice. However, as you discovered yourself maybe a generic solution is just not feasible. Maybe a more loose, component-like approach is better.
Yes I'm quite certain that would be the direction to go. I've recommended an XForms interpreter that converts to HTML/CSS/JS but another possible direction would be to provide a library to assist with everything other than the HTML output itself because that is just too changible. Trouble is that is at least 60% of what the a forms library usually does. There may be compromises however.
(I would be willing to help, but my time and skills are limited so I certainly can't pull the project)
heh everybody is the same on that front. I've already dedicated a huge amount of time. A friend said that it was 8 months, not 6. So unless a whole group of really good programmers came up to me I'd probably not be willing to commit myself. I could certainly act as a consultant that may be useful to you initially.
But if that's not going to happen, maybe it would be nice to learn more about your experiences developing this. Have you written down things? What were your main problems and hurdles? What decisions did you have to make? I think it would be very useful for many of us to learn from your experiences, successes and mistakes.
No I haven't written down things. But I remember a lot. I probably should write some things down. But I've got versions 2, 3 and 4 of the library stored so I can look and see what I've changed over time. I'll certainly remember the reasons why. I really should get myself a blog. I usually have plenty to say; you might have noticied ;)
matthijs wrote:Hi, thanks for your reply. I noticed you are very busy with the event coming up Smile

I'll keep it short then: I agree.

it's 11pm here and I just finished working on a 1 page form, nothing spectacular but nonetheless 6+ hours of work coding everything by hand, checking, validating everything etc etc. Very boring and not-fun work. There should be an easier way! Each time again and again I say that to myself.

Even though I reuse some snippets it stays a lot of work. I have looked at many form classes and packages but most of the times they are not flexible enough.

What I'll do is think about this, study possibilities and post whatever thoughts, snippets and questions I have on the forum. Whenever you happen to be able to contribute to the discussions that follow your knowledge will be very useful.

Cheers, Matthijs
I wrote:Hmmm perhaps I should do a podcast. You've inspired me a bit.

Laters
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: I was going to release a demo of OsisForms today but...

Post by Christopher »

I noticed this one thing:
ole wrote:It's not that the project is impossible or even that it was a bad idea.
I think it might be impossible to create a universal system, and that it may very well be a bad idea.

As you know from your experience, you started to run into the law of diminishing returns. This seems to be the case for Forms libraries and things like O/RM systems. You ended up with a fairly large code base (not the largest forms library I have seen though ;)) yet the functionality improve over very simple solutions is both incomplete and not very great.

The fault is not yours so you certainly should feel good about your accomplishment -- you just picked a very difficult problem to solve.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

there is definitely a reason nobody has yet designed a forms library that is easy to use and satisfies the needs of the majority of php developers. I think it's very difficult to incorporate both validation, and display into one library. My ideal forms library would leave all display up to me. I don't want a library to decide how to display my forms. Just generate an object or array with all of the display information that is easy to understand and use, and I'd be happy... this is where HTML_Quickforms takes a dump (as well as other places) unfortunately.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: I was going to release a demo of OsisForms today but...

Post by matthijs »

Ok, probably a single "universal" solution is not possible and even a bad idea. But I do not believe there's nothing at least in the direction of some more reusable code.

One problem with forms is that each one is different. Maybe a couple of login forms look alike, but that's it. And it's important that the design of them can be completely controlled. As Ninja says, you want complete control over the HTML. So that's one tier of the system which must stay totally independent.

Then there is the validation side. This one must be controlled by the back end programmer. Again with maximum flexibility. And not only server-side, but also client-side. Preferably those two are independent as well. Even though reuse of the same validation rules would be nice (for ease of maintenance).

So I think there shouldn't be a single library doing everything at once, but a few components responsible for different parts of it. A bit like Arborint's skeleton code. Very clean, easy to reuse classes.

Well, forms are one thing that will keep coming back as work so as long as I have to make them I'll try to improve the process. And I'll keep searching for solutions which make it easier for me. And if you guys don't want to share your secret (library), that's fine ;) :D
(I mean, is everyone of you just handcoding each and every form?)
wei
Forum Contributor
Posts: 140
Joined: Wed Jul 12, 2006 12:18 am

Post by wei »

regarding forms,

below is a simple demo of "scaffolding", it generates the default form from an active record class
http://xlab6.com/p3/demos/quickstart/?p ... ffold.Home
http://xlab6.com/p3/demos/quickstart/?p ... d/Home.php

this is build upon the Prado framework, something similar to asp.net controls.

clearly, the scaffolding forms are simplistic and not much room for customization

A more complex is possible, but takes alot more work than the above few lines,

http://xlab6.com/prado/examples/wizard.php

One design that is very useful is to capture a set of form inputs into custom "component". E.g. create a custom login "component" that has two text inputs and a button. This allows you to define your own set of complex "components" to be reused later. This is how the scaffold "components" was built.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Then there is the validation side. This one must be controlled by the back end programmer. Again with maximum flexibility. And not only server-side, but also client-side. Preferably those two are independent as well. Even though reuse of the same validation rules would be nice (for ease of maintenance).

So I think there shouldn't be a single library doing everything at once, but a few components responsible for different parts of it. A bit like Arborint's skeleton code. Very clean, easy to reuse classes.
It is impossible to completely separate. For instance validation immediately implies reporting errors back to the user, and that's output.

That problem actually continues in other areas as well: One of the reasons why a forms library is so necessary is because of the mixing of responsibilities and even languages involved in writing forms monolithically. Trouble is that mixture occurs for a reason - these layers do need to communicate. Now that's not to say that they can't be represented as separate object hierarchies but just that the distinctions are going to require a lot of consideration (a lot of which I did do) and the result is going to be a complex API...that's exactly what I ended up with.

On the left you have:
  • Flexibility
  • Complex API
  • A lot of effort to make and to learn to use but ultimately very good
on the right you have
  • Simplicity
  • Rigidity OR not a lot is actually done for you
  • Probably not really worth using
I'm not sure a happy medium exists here. I tried all of sides of the equation; initially trying to make it really simple and rigid and then later more flexible and complex. The thing about having something complex is you can always put a layer on top that simplifies it such as XML interface, prefabricated components, direct generation from DB schema etc. You can't do it the other way round. The only issue with the flexible complex API + simplification is all the extra work. The flexible route is definitely the way to go and isn't impossible at all its just a lot of work and there would need to be a team of 4 or so very good developers.

The alternative is probably a bunch of simple objects and functions that can be used to solve very specific problems in the domain but don't really communicate unless you put that communication in (example). There's probably is a fair bit of value in something like that but it's not exactly going to set the world on fire.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

No matter what comes of it ole, you have improved as a developer. Good job man. And my hats off to you for the way you handled it.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Interesting Ole. I think I understand the issues. I have played with some form packets and certainly the "does-it-all" but very rigid solution sounds familiar. As soon as a package does a lot for you it's very difficult to be able to control the details.

I think the first thing you'd have to start on is defining how in an ideal situation you'd want to be able to work with the library. But I can imagine that how you do that can vary wildly depending on preferences and experiences. Do you want the front-end people to only work with non-php templates, or is it ok to let them code something like:

Code: Select all

..
<div><input type="text" name="name" value="<?php $formfield['name']->value(); ?>" />
<span><?php $formfield['name']->error(); ?></span></div>
...
Or are you thinking about a form library that works like:

Code: Select all

<?php $form->printform(); ?>
That last example is not so good, but shows how some solutions handle this. What I find really stupid is when it goes like:

Code: Select all

<?php
$form = new Form;
$form->addElement('<tr>');
$form->addElement('<label>..</label>');
...
$form->render();
?>
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

What about something that goes:

Code: Select all

$outputType = 'xhtml';
$builder = new XmlFormBuilder($outputType);
$xml = <<< XML
<formDefinition>
    <!-- Something based on XForms perhaps -->
</formDefinition>
XML;
$builder->addDefinition($xml);
$form = $builder->build();
echo $form->render();
XForms is an example of a successful abstraction of forms.
Everah wrote:No matter what comes of it ole, you have improved as a developer. Good job man. And my hats off to you for the way you handled it.
Thanks man. I've decided I'm going to sit down and write an article on the failures and successes of form abstraction in PHP. I'm not setting any date though just yet.
Post Reply