Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OOP design
Message
De
06/06/2003 13:38:37
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
06/06/2003 04:46:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00797072
Message ID:
00797367
Vues:
13
Hi John,

I use a data-driven Strategy table (in conjunction with a data-driven Abstract Factory) to determine which class to instantiate. Both are based on the Abstract Factory by Andy Kramek and Marcia Akins presented in a FoxTalk issue a while back. My code usually ends up looking something like:
Local loItem as aItem of items.vcx, lcItemType

lcItemType = ...
loItem = Strategy("Item", lcItemType)
loItem.DoSomething()
>Hi,
>I am developing Inventory control system. In my design, it should able to manage multiple type of product such as normal item (such as cann food), serialno'ism' item (such as electrical ite, mobile device) and matrix item (such as fashion item, clothes).
>
>For these 3 different type of item, there have different/same attributes for example:
>normal item : SKU, Barcode
>serialno item : SKU, Barcode (may be), serial no, model
>matrix item : SKU, BarCode (different colour/size will have different barcode generated), ColourCode, SizeCode, Model
>
>My question is, how to design classes that able to handle these 3 items (ex. while collecting data, display data, validate data) with same interface without DO CASE ...ENDCASE in all around my UI/Business layer?
>
>I used to think about strategy patttern, however, It still seem DO CASE ...ENCASE is required in UI level while collecting/doisplay data.
>
>Any ideas, or example for similar problems?
>
>Thank you
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