Welcome Guest, Not a member yet? Register   Sign In
best practices on Form Reuse - keeping all forms in a central location with validation
#31

[eluser]chuckleberry13[/eluser]
Yeah it took me awhile to be ok with using ME, but when I ran into this problem and realized how easily it solved the problem, I've got to admit I've become a fan.

P.S. If you knows of ways it could be abused please pipe up.
#32

[eluser]Randy Casburn[/eluser]
Ok guys - I'm playing catch up, and I'm not being an ass. But someone must tell me why all the overhead of ME is required to do something so blastedly simple as that represented in this post: http://ellislab.com/forums/viewreply/434669/

ME is powerful and does great stuff. But in this case if you decompose what you have done, all that is left when the salt is boiled away is a lot of fancy Objectivity that looks cool, sounds great, makes us feel like we're landing on Mars and all it does is what is represented in a single, simple static function call.

Why not call it in a simple one line function call with no overhead at all. This goes back to this post. http://ellislab.com/forums/viewreply/434309/ with the code modified and moved over per the above post.

Look at this objectively and you'll see it. If you don't believe me, run the code and it will demonstrate it. I can use the same definition over and over where ever I need it.

Not everything has to be so convoluted. In fact, most things need to be simple!

But hey...IMHO.

Make this more challenging so you can defeat my argument.

Randy
#33

[eluser]chuckleberry13[/eluser]
Are you suggesting that you just call something like a helper function that contains the validation rules and form body?

In my particular case I am needing to use ME for other parts of my application so I don't mind the overhead, but if somebody didn't need ME I would agree its overkill for just re-using a form.
#34

[eluser]Randy Casburn[/eluser]
Not the form body, just the validation rules and supplemental code.
#35

[eluser]Randy Casburn[/eluser]
And too extend the theme a little...

I don't think of these things necessarily as "forms", or especially as "forms that go with controllers" or "forms that go with pages" etc.

I look at them more along the lines of "validations" that go with "field elements" that go with "form purposes".

That way I'm goal oriented and focus on the use case goal rather than focused on the CODE GOAL. There is a BIG difference...IMHO ;-)

Does this make sense?

Randy
#36

[eluser]chuckleberry13[/eluser]
Yeah that does make sense in theory. I will try it out and see if I run into any hiccups. Thanks for being patient enough to explain your thoughts.
#37

[eluser]Randy Casburn[/eluser]
[quote author="chuckleberry13" date="1217059922"]In my particular case I am needing to use ME for other parts of my application so I don't mind the overhead...[/quote]

Please don't...you're app is up and running ME. You should stay there. I though you pulled in ME JUST to solve this problem.

Rock on man. You are doing great.

Randy
#38

[eluser]Colin Williams[/eluser]
Quote:I look at them more along the lines of “validations” that go with “field elements” that go with “form purposes”.

That way I’m goal oriented and focus on the use case goal rather than focused on the CODE GOAL. There is a BIG difference...IMHO

I guess when I think of "use case goal," I'm think like, the use case for this form is "login" and for this one it's "search" and for this one it's "save blog post." I'm not even sure what a "CODE GOAL" is either? I mean, is the goal of the code to implement the use case. I'm probably just looking at it differently. What I mean is, I still disagree. With everybody Tongue
#39

[eluser]Randy Casburn[/eluser]
code goal = do it the way the code monkey wants it done regardless of anything else...because according to the code monkey o-the-day its the best way. And the rhyme was on purpose :lol:

and -- THERE you did it again, you said:

Quote:the use case for this form is “login”

I never said use case goal for the FORM. The use case isn't focused on the Form silly! If you want to hijack this thread and talk about guard conditions for state transitions and guard conditions for activity diagrams and why these validation conditions are going to show up there and how these diagrams demonstrate and support use case goals we can, but I'd rather not hijack _another_ thread.

Randy
#40

[eluser]chuckleberry13[/eluser]
I still want to try out your theory because I really like the idea of validating elements (fields) and not just forms.




Theme © iAndrew 2016 - Forum software by © MyBB