Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Object question
Message
De
29/05/2003 10:24:47
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
29/05/2003 04:38:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00793835
Message ID:
00793930
Vues:
27
This message has been marked as a message which has helped to the initial question of the thread.
Hi Kevin,

>
>I have a business object and when I call the Save method it returns the primary key so that the front-end can update the client-side cursor.
>
>However, if the Save fails because of business rule violation, how can I handle this? I was thinking of putting a STATUS property that gets updated after each Save, but I was under the impression that BO's should be stateless, and this would break that rule.
>
>Can I have some suggestions on this?
>

Like Craig suggested, I return a negative value in a similar situation. If you want to return more information, like the reason the save failed, you could pass in a parameter by reference (ie. @lcStatus) and set it inside the BO. Passing by reference isn't my favorite option, but it keeps the object stateless and should work with Web Services as well.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform