I have a static class (VS 2010/C#) used to generate pdf documents from a template. We use iTextSharp APIs to generate the pdf. The class is static, providing only a public method to generate a specific document.
Now we need to implement a new document class to generate a different kind of document. I would like to create a base class, since some methods will be shared by the two classes, while others will be specific to each document type.
How would be the better approach in order to keep the specific (sub)class static and avoid making the base class public or invokable from outside the specific classes?
I am currently looking into Factory Pattern or composition.
EDIT: Here the current specific class code:
public static class SpecificDocGenerator
{
/// <summary>
/// Generates an international certificate.
/// </summary>
public static byte[] GenerateItDoc(DocInfo info)
{
//Here the document is generated and returned as byte array
}
/// <summary>
/// Gets the resource.
/// </summary>
private static byte[] GetResource(string name)
{
//Gets a local resource (as example an image)
}
I would liekt to create a base class for common methods (as example GetResource). But I would like to keep the specific class static or avoid making more instances of it.