Web App Architecture - how to solve this problem?

Web App Architecture - how to solve this problem?

Basic core principles - Our web app/platform are decoupled into 3 tiers
  • Interface (i.e thin client interface)
  • Business Logic/Services
  • Data Models
 There are at least 2 different eSpaces for each tier! plus 1 database extension or 3 eSpaces in total.

The interface is just a thin client interface, (web app and mobile app) it contains interface only.

How it works? simple form example
1) User fills out form (interface tier) and clicks submit
2) Web app calls web service method (Services Tier)
3) web service responses back with success or failure acknowledgement, if failure an error list is returned.
4) We now need to loop through the web service "Error" list to flag each field with the corresponding error message.
APIMETHOD.Response.Errors.Current.Property contains the structure attribute name where the error occurred
APIMETHOD.Response.Errors.Current.DetailedMessage contains input validation message.
Loop thru error list to match Error.Property and flag specific error
FormWidget.Valid = false
FormWidget.ValidationMessage = Error.DetailedMessage

The problem is we can not loop through the widget fields! because outsystems input validation widget does not provide the validation message in an array! (You have to manually flag Valid=False, ValidationMessage etc)

Would EventSystem solve this problem? 

Note Currently we have a work around solution, and that is we have to manually flag each individual error message - all manual work (I would prefer to do no manual work, flagging the widget error message via a loop is preferred)

Hi Robert,

Does the split really need to be so aggressive? 

I understand the concept of wanting the Interface layer to be as thin as possible, but considering all the communication and extra logic needed (even if it was possible to iterate over the inputs as an array) it feels a bit over architecture. 

Especially since there is a very tight coupling between the attributes that the interface shows and the does that the service knows, so that they always match to give proper errors.

Better yet, just thinking about the UX of it on a mobile application I would want to keep as much validations as possible in the client side just to give the user a awsome and fast experience for most validations, even if they need to be redone on the server for security reasons.

If you need to go to the server, call a service and then give user feedback, that would injure the experience just for architectural purposes.

Well, this is my personal opinion on the subject, but would be nice to see other opinions.

João Rosado