refactor: update class method signatures and improve initialization in Person and Student classes

lab2
Artem-Darius Weber 1 week ago
parent 09c78690f1
commit a78cbb3a67

@ -40,29 +40,28 @@ classDiagram
- id : String - id : String
- git : String - git : String
- contact : Contact - contact : Contact
+ Person(id : String, git : String, contact : Contact) + Person(id : String, git : String, contact : Contact = new Contact())
+ git_present() : Boolean + git_present() : Boolean
+ contact_present() : Boolean + contact_present() : Boolean
+ contact_info() : String + contact_info() : String
+ git=(String) : Boolean + git=(git : String) : void
- validate_id(id: String) : Boolean - validate_id(id: String) : void
- validate_git(id: String) : Boolean - validate_git(git : String) : void
- validate_contact(contact : Contact) : void
- valid_git(git : String) : Boolean - valid_git?(git : String) : Boolean
- valid_id(id : String) : Boolean - valid_id?(id : String) : Boolean
} }
class StudentRepository { class StudentRepository {
+ read_from_txt(file_path : String) : List~Student~ + self.read_from_txt(file_path : String) : List~Student~
+ write_to_txt(file_path : String, students : List~Student~) + self.write_to_txt(file_path : String, students : List~Student~)
} }
class StudentShort { class StudentShort {
- surname_initials : String - surname_initials : String
- contact : Contact
+ StudentShort(id : String, git : String, surname_initials : String, contact : Contact) + StudentShort(id : String, git : String, surname_initials : String, contact : Contact)
+ from_student(student : Student) : StudentShort + self.from_student(student : Student) : StudentShort
+ from_string(id : String, info_string : String) : StudentShort + self.from_string(id : String, info_string : String) : StudentShort
+ to_s() : String + to_s() : String
} }
@ -71,12 +70,19 @@ classDiagram
- name : String - name : String
- patronymic : String - patronymic : String
- birth_date : Date - birth_date : Date
- const NAME_REGEX : String
+ Student(id : String, git : String, contact : Contact, surname : String, name : String, patronymic : String, birth_date : Date) + Student(id : String, git : String, contact : Contact, surname : String, name : String, patronymic : String, birth_date : Date)
+ from_string(student_string : String) : Student + self.from_string(student_string : String) : Student
+ surname_and_initials() : String + surname_and_initials() : String
+ to_s() : String + to_s() : String
+ get_info() : String + get_info() : String
- validate_student() + surname=(surname : String)
+ name=(name : String)
+ patronymic=(patronymic : String)
+ birth_date=(birthdate : String)
+ self.valid_name?(name : String) : Boolean
- name_initial(name : String) : String
- patronymic(patronymic : String) : String
} }
BinarySearchTree o-- Node BinarySearchTree o-- Node

Loading…
Cancel
Save