Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OOP design
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00797072
Message ID:
00797292
Views:
13
I imagine you have business objects that look something like:
define class aItem as custom
   cSKU = ''
   cBarCode = ''

   Function GetDataBySKU
   EndFunc
EndDefine

Define class cNormal as aItem
EndDefine

Define class aModelItem as aItem
   cModel = ''
EndDefine

Define class cSerialNoItem as aModelItem
   cSerialNo = ''
EndDefine

Define class cMatrixItem as aModelItem
   cColorCode = ''
   cSizeCode = ''
EndDefine
You than can create any methods particular to each property in the class definition it was defined, like GetDataBySKU. This may be a template method and be defined in each of the subclasses, or if generic enuf, be defined in the base class.

As to the UI stuff, I'll assume that the user will be entering a SKU #. We don't know what kind of item it is yet, so I'd make a generic container to trap the SKU#. Once I know the SKU, I would have different containers with the UI fields in a similar hierarchy as above. So I the SKU is a Matrix item, the appropriate fields would be in the container. The container for model item would have their controls etc.

Hope this was clear.
Best of luck.
>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
Mark S. Swiencki
EPS Software www.eps-software.com
mark@eps-software.com
Previous
Reply
Map
View

Click here to load this message in the networking platform