I'm trying to familiar myself with design pattern and interested to learn Abstract Factory design. I have looked at a few examples and i'm curious about the UML diagram. In Abstract Factory design, we have Abstract Factory and Abstract Product interfaces. In Abstract Factory, most examples i look at they always have member functions with return types of Abstract Product, but how come this relationship is not mentioned in UML diagram?
interface IHonda
{
//members of abstract product
IVehicle CreateVehicle();
IHomeCare CreateHomeCare();
}
//Abstract Product
interface IVehicle
{
double GetVehiclePrize(string car);
int GetVehicleYear(string car);
int GetVehicleRating(string car);
}
//Abstract Product
interface IHomeCare
{
double GetHomeCarePrize(string car);
int GetHomeCareYear(string car);
}
Aucun commentaire:
Enregistrer un commentaire