cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: [cForms] Errors coming from service layer
Date Mon, 14 Mar 2005 14:16:51 GMT
Vilya Harvey wrote:
> Reinhard Pötz wrote:
> 
>>
>> Imagine following scenario: You have a service layer that is exposed 
>> as web services. cForms already does as much validation as possible 
>> but some complex checks can only be performed by the backend.
>>
>> If I call a webservice (via Axis client) this webservice can return 
>> errors (how this is done hasn't been defined yet).
>>
>> Are there any best practices or experiences how to map errors coming 
>> from the service or domain layer to cForms widgets? (The error has to 
>> appear at widget level.)
> 
> 
> In your flowscript, you can create your own ValidationError object and 
> explicitly set that on the apppropriate widget.
> 
> What we did was to define our own type of exception which included 
> information about all validation errors that were found, then wrote a 
> simple(-ish) flowscript function which handled looking up the relevant 
> widgets, creating the error objects and setting them into the widgets.

Thank you!

This means that the service layer is aware of which widgets exist? I'm not sure 
if I (and especially my customer) likes this bi-directional dependency ...

-- 
Reinhard Pötz           Independant Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Mime
View raw message