Given that I have 3 classes Asset, AssetA, AssetB what is the proper way to structure inheritance when using the factory method?
Here is how I would like to use these classes:
Asset.new(data)should deterministically create eitherAssetAorAssetBdepending on some flag present indataAssetshould also act as a super class in a sense that it's methods should also be present inAssetAandAssetB
Aucun commentaire:
Enregistrer un commentaire