Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class
- APPLICATION
- inherit
- ARGUMENTS
- create
- make
- feature {NONE} -- Initialization
- make
- -- University model demo
- local
- l_university: UNIVERSITY
- l_course_contracts, l_course_comments: COURSE
- l_instructor_bertrand, l_instructor_instructing: INSTRUCTOR
- l_assistant_assisting, l_assistant_helping: ASSISTANT
- l_student_alpha, l_student_bravo, l_student_charlie: STUDENT
- l_year_bs1, l_year_ms1: YEAR
- l_time_morning, l_time_evening: TIME
- l_room_123, l_room_248: ROOM
- l_teaching_week_first, l_teaching_week_last: TEACHING_WEEK
- do
- create l_time_morning.make (9, 15)
- create l_time_evening.make (18, 30)
- create l_room_123.make (123)
- create l_room_248.make (248)
- create l_year_bs1.make ({YEAR}.bs1)
- create l_year_ms1.make ({YEAR}.ms1)
- create l_instructor_bertrand.make_with_name (create {NAME}.make ("Bertrand", "Meyer"))
- create l_instructor_instructing.make_with_name (create {NAME}.make ("Instructing", "Meyer"))
- create l_assistant_assisting.make_with_name (create {NAME}.make ("Assisting", "Meyer"))
- create l_assistant_helping.make_with_name (create {NAME}.make ("Helping", "Meyer"))
- create l_course_contracts.make ("Contracting", l_year_bs1, l_instructor_bertrand, <<l_assistant_assisting>>)
- create l_course_comments.make ("Commenting", l_year_ms1, l_instructor_instructing, <<l_assistant_assisting, l_assistant_helping>>)
- create l_student_alpha.make_empty (create {NAME}.make ("Apple", "Alpha"), l_year_bs1)
- create l_student_bravo.make_empty (create {NAME}.make ("Bending", "Bravo"), l_year_bs1)
- create l_student_charlie.make_empty (create {NAME}.make ("Constant", "Charlie"), l_year_ms1)
- create l_university.make_with_name ("EIFFEL4LIFE")
- l_university.assistants.extend (l_assistant_assisting)
- l_university.assistants.extend (l_assistant_helping)
- l_university.instructors.extend (l_instructor_bertrand)
- l_university.instructors.extend (l_instructor_instructing)
- l_university.courses.extend (l_course_comments)
- l_university.courses.extend (l_course_contracts)
- l_university.students.extend (l_student_alpha)
- l_university.students.extend (l_student_bravo)
- l_university.students.extend (l_student_charlie)
- create l_teaching_week_first.make
- create l_teaching_week_last.make
- l_teaching_week_first.monday.lectures.extend (create {LECTURE}.make (l_course_contracts, create {TIME_AND_ROOM}.make_at (l_room_123, l_time_evening)))
- l_teaching_week_last.sunday.lectures.extend (create {LECTURE}.make (l_course_comments, create {TIME_AND_ROOM}.make_at (l_room_248, l_time_morning)))
- l_university.schedule.teaching_weeks.extend (l_teaching_week_first)
- l_university.schedule.teaching_weeks.extend (l_teaching_week_last)
- l_student_alpha.courses.extend (l_course_comments)
- l_student_bravo.courses.extend (l_course_comments)
- l_student_charlie.courses.extend (l_course_contracts)
- io.put_string (l_university.out)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement