Self-complete

This commit is contained in:
2026-05-22 14:49:02 +03:00
parent 0e74a9eb90
commit a5d6b3af21
47 changed files with 7003 additions and 570 deletions
+124 -23
View File
@@ -1,42 +1,143 @@
@startuml
skinparam classAttributeIconSize 0
class Property {
# double price
# string address
+ show()
+ clone()
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 {
- int rooms
+ show()
+ clone()
#square : double
+calculateTax() : double
}
class Car {
- string brand
- int horsepower
+ show()
+ clone()
#horsepower : double
+calculateTax() : double
}
class CountryHouse {
- int floors
- double landArea
+ show()
+ clone()
}
class City {
- vector<Property>
+ addProperty()
+ showAll()
#distanceFromCity : double
+calculateTax() : double
}
Property <|-- Apartment
Property <|-- Car
Property <|-- CountryHouse
City o-- Property
' =======================
' OWNER
' =======================
class Owner {
-fullname : string
-inn : string
-properties : vector<Property*>
+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<Owner*>
+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