![]() IVisitor interface exposes visit() method and has several overloaded versions of it so that it can accept different types of InvoiceElement as its paramters. Hence Invoice class clearly simplify its functionality by delegating the implementation of its extended features to different types of visitors. This method enables to extend the functionality of the original class, Invoice in our case by implementing different types of visitors without doing changes to these classes. All the concrete visitor classes must implement this interface. InvoiceElement interface expose one method accept() which accepts IVisitor as its parameter. Each of these classes implements InvoiceElement interface. Invoice for this example contains three key InvoiceElements namely HeaderElement, OrderElement and FooterElement. It implements InvoiceElement interface and also maintains list of all invoice components. Class Diagram of Customer Invoicing Systemįrom the above class diagram you can see that Invoice is a conceptual class responsible for defining the structure of an invoice. The detailed explanation is given below.įigure 1a. There are two key interfaces defined InvoiceElement and IVisitor. Figure 1a shows the first class diagram which contains key classes which are related to Generation of Invoice and saving of Invoice in XML format. One diagram would have looked cluttered so I have logically grouped them based on their responsibilities. ![]() I have prepared two class diagrams to explain the key classes and their roles in this application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |