Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
3-tier programming, Codebook, and business classes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00083772
Message ID:
00085176
Vues:
48
>This particular approach seems like it would be a lot of work. You actually hardcode the mappings between your controls and your business object in your RefreshData method?

Michael,

It is no more work than any other approach that isn't using data binding. A good deal of it can be automated in control classes. The examples I posted didn't show all of that because that has nothing to do with the N-Tier design.

Here's a textbox class that would be used with the busobj.
DEFINE CLASS txtBusiness AS Textbox
  busControlSource
  
  PROCEDURE Refresh
     LOCAL lcSource
     IF NOT EMPTY( THIS.busControlSource )
        lcSource = THIS.busControlSource
        THIS.Value = THISFORM.busObj.&lcSource
     ENDIF
  ENDPROC
ENDDEFINE
Now a simple THISFORM.Textbox.Refresh() will update the value of the textbox. The LostFocus could be coded to automate the PutFieldData call to the business object.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform