@startuml skinparam classAttributeIconSize 0 title Lab8 - Property Tax System ' ======================= ' ENUM ' ======================= enum FileType { JSON XML ANOTHER } ' ======================= ' INTERFACES ' ======================= interface Ijsonio { +fromJson(json) +toJson() : json } interface Ixmlio { +fromXml(XMLElement*) +toXml(XMLDocument&) : XMLElement* } ' ======================= ' ABSTRACT CLASS ' ======================= abstract class Property { #worth : double +Property(worth) +calculateTax() : double +incomeTax() : double +fromJson(json) +toJson() : json +fromXml(XMLElement*) +toXml(XMLDocument&) : XMLElement* +~Property() } Property ..|> Ijsonio Property ..|> Ixmlio ' ======================= ' DERIVED CLASSES ' ======================= class Apartment { #square : double +calculateTax() : double } class Car { #horsepower : double +calculateTax() : double } class CountryHouse { #distanceFromCity : double +calculateTax() : double } Property <|-- Apartment Property <|-- Car Property <|-- CountryHouse ' ======================= ' OWNER ' ======================= class Owner { -fullname : string -inn : string -properties : vector +addProperty(Property*) +removeProperty(int) +calculateTotalTax() : double +showProperties() +fromJson(json) +toJson() : json +fromXml(XMLElement*) +toXml(XMLDocument&) : XMLElement* +~Owner() } Owner ..|> Ijsonio Owner ..|> Ixmlio Owner *-- Property : owns ' ======================= ' FACTORY ' ======================= class PropertySimpleFactory { +static getProperty(key : string) : Property* } Owner ..> PropertySimpleFactory ' ======================= ' SERVICE LAYER ' ======================= class TaxService { -owners : vector +load(filename) +save(filename) +loadFromJson() +saveToJson() +loadFromXml() +saveToXml() +addOwner() +removeOwner() +addProperty() +removeProperty() +showOwners() +~TaxService() } TaxService o-- Owner ' ======================= ' FILE TYPE FACTORY ' ======================= class FileTypeFactory { +static getFileType(filename) : FileType } FileTypeFactory ..> FileType @enduml