Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's a component.
Message
 
À
02/11/1999 13:42:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00284554
Message ID:
00285623
Vues:
22
>>>A phone business object could both apply the rule to any requests to update the back-end but also expose a GetMask() method that would return the mask to the front-end for UI implementation. The business object could either store the mask as a property or have a encapsulated method to retrieve it from the data dictionary. Would that work?
>
>Do we really want that many (potentially costly perf-wise) COM or DCOM calls just to have an "ideal" design? BTW, I don't know the right answer. :-)

I don't either, I'm just guessing. But I would think that simple formating validation would be better handled by the UI so that erroneous data is not sent across, only to be bounced back as a failed update.

Example:

We have a business object called oBusPhone

* User enters 555-1212
The UI calls oBusPhone.PutPhone('555-1212')
oBusPhone returns 1 - Incorrect formatting.

*UI notifies user to try again with better formatting
* User enters (954)555-1212

Ui calls oBusPhone.PutPhone('(954)555-1212')
oBusPhone returns 1 - Incorrect formatting.

*and so on until the user gets it right.

Or the UI could do:
this.inputmask = oBusPhone.GetMask()
* User enters phone number (UI handles the masking, nothing gets sent until the number is entered correctly)
oBusPhone.PutPhone('954-555-1212')
oBusPhone returns 0 - Success

So you grab some additional info once and only send correct info back to the business object.

Of course you could always just build parsing code into the business object to handle the formatting by itself.

Again, I'm just guessing here so....
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform