Let's say I have a group of classes that generate documents from templates. For instance...
class CustomerInvoice
{
public satic string TemplatePath
{
get { return @"C:\Templates\InvoiceTemplate.doc"; }
}
public static DocumentType DocumentType
{
get { return DocumentType.WordDocument; }
}
public static void Create(Customer customer, int orderNumber)
{
}
}
All these classes have the same method name, but not necessarily the method signatures.
For example, I may have
CustomerInvoice.Create(Customer customer, int orderNumber);
DespatchNote.Create(Customer customer, int orderNumber, Warehouse warehouse);
PackingLabel.Create(int orderNumber);
... or something else (trying my best to find reasonable examples).
Is there a mechanism in OO that determines which method names have a group of classes this way? I really think that I have a way to ensure consistent implementation and naming of a group of similar objects, so they are more intuitive for consumers. Would such a case be considered a valid / appropriate use of any such technique?
source
share