I recently embarked on an automated testing project and implemented the 
advantages you mention by automatically generating *one* project method per 
form that contains all of the object method and form method code. The only 
other task was to create wrappers for Form event and OBJECT Get pointer to 
allow them to be programmatically manipulated.

So no rewriting of the form is necessary, no need to call a project method from 
every object method, and no need to maintain an enormous case statement for a 
form with lots of object methods. The "form controller" idea others have 
mentioned might be nice for newer projects, but would be a huge amount of work 
for legacy projects where object names did not exist. My generated code has 
lots of "Field1", "Field2", "Button1" names because object names never mattered 
when the forms were created.

John DeSoi, Ph.D.


> On Apr 20, 2017, at 4:34 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Using a project method in place of a a form method/object scripts has a
> couple of other advantages. If you pass in the event code, then you can:
> 
> * Create custom event codes ('redraw', 'close' or something more like a
> message)
> 
> * Emulate form activity (useful for testing)
> 
> * Leverage your existing code with CALL FORM. Your CALL FORM call invokes
> the form handler method and passes in whatever event or data is required.

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to