This is just my opinion, but after looking at the code I would say
that Form.element has a lot more to do with the retrieving data
(serialize, getValue) and Field has a lot more to do with the state of
the field (clear, focus, select, etc).  I guess in the end it doesn't
really matter because they are static methods.  But you are right
there is no functional reason to split them up.

Nicholas

On 5/11/06, Eric Anderson <[EMAIL PROTECTED]> wrote:
Quick design question. I am trying to get a better understanding of
Prototype. While reading through the source I am stumped by form.js.
There is a "Field" object and a "Form.Element". Both object seem to
consists of a series of actions that making interacting with form fields
easier.

My question is why two objects? It seems that there should be one object
that has this functionality. Is there a design reason behind this? Or is
it just because of historical accident? They seem to have overlapping
purposes. I couldn't determine the reason for myself so I figured I
would go to the source.

Eric

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs



--
DCRails.com || Making the Metrorail fun!
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to