Ex 07, short questions
Moderatoren: pmueller, SE - Design and Construction
Ex 07, short questions
Hi,
two short questions:
- May we use case classes for SimpleUniversity and ComplexUniversity? The debug Strings produced by the administration tool are more understandable if we do so.
- The method declaration in Student should be "matriculationNumber", right? I declared it that way now.
Best,
Ben
two short questions:
- May we use case classes for SimpleUniversity and ComplexUniversity? The debug Strings produced by the administration tool are more understandable if we do so.
- The method declaration in Student should be "matriculationNumber", right? I declared it that way now.
Best,
Ben
Re: Ex 07, short questions
Hi,
Best,
Patrick
Yes.
Do you mean the classes themselves or the Types they should contain?
Best,
Patrick
Re: Ex 07, short questions
Thanks!
I mean the classes contained in SimpleUniversity and those contained in ComplexUniversity.
Best,
Ben
I mean the classes contained in SimpleUniversity and those contained in ComplexUniversity.
Best,
Ben
Re: Ex 07, short questions
I have an additional question regarding this. In the assignment it is stated, that within TSimpleUniversity there should be a trait corresponding to Student with the following methods declared:
Is it on purpose, that there is a second method courses that returns a Sequence typed to an additional class named Courses? If so, how do we know what this additional class "Courses" should look like?
Is it on purpose, that there is a second method courses that returns a Sequence typed to an additional class named Courses? If so, how do we know what this additional class "Courses" should look like?
Re: Ex 07, short questions
Another question regarding task 1.2 with the ComplexUniversity Class.
Should the types for Student, CourseOfStudies, Room and Course mix up the methods of both, TComplexUniversity and TSimpleUniversity?
So that this code will be possible?:
Should the types for Student, CourseOfStudies, Room and Course mix up the methods of both, TComplexUniversity and TSimpleUniversity?
So that this code will be possible?:
Code: Alles auswählen
val cUni = new ComplexUniversity
val r1 = cUni.Room("Room1", "Building1")
val hurr = r1.building()
val durr = r1.number()
Re: Ex 07, short questions
Hi,
Best,
Patrick
Yes.emod02 hat geschrieben: ↑21. Jun 2018 16:46Another question regarding task 1.2 with the ComplexUniversity Class.
Should the types for Student, CourseOfStudies, Room and Course mix up the methods of both, TComplexUniversity and TSimpleUniversity?
So that this code will be possible?:Code: Alles auswählen
val cUni = new ComplexUniversity val r1 = cUni.Room("Room1", "Building1") val hurr = r1.building() val durr = r1.number()
Best,
Patrick
Re: Ex 07, short questions
Hi,
Okay. And we should not mix it up in TComplexUniversity, as I understood it rigth?
Then I'm totally lost.
I have no clue, how I should create an instance of the mixed up traits of the super classes TComplexUniversity and TSimpleUniversity in the ComplexUniversity class.
Maybe someone can give me a hint into the right direction?
Greets Dominik
Okay. And we should not mix it up in TComplexUniversity, as I understood it rigth?
Then I'm totally lost.

I have no clue, how I should create an instance of the mixed up traits of the super classes TComplexUniversity and TSimpleUniversity in the ComplexUniversity class.
Maybe someone can give me a hint into the right direction?
Greets Dominik
Re: Ex 07, short questions
Hi,
just as a heads up: in this exercise you will most likely produce code that is not accepted by the parses of IDEs(at least IntelliJ), but by the scala compiler.
So maybe you should try compiling your solution with sbt or scalac directly before dismissing it.
Best,
Patrick
just as a heads up: in this exercise you will most likely produce code that is not accepted by the parses of IDEs(at least IntelliJ), but by the scala compiler.
So maybe you should try compiling your solution with sbt or scalac directly before dismissing it.
Best,
Patrick
Re: Ex 07, short questions
Thank you for this hint, I was quite confused that IntelliJ complained about classes inheriting from multiple traits, but it still compiles and works fine!pmueller hat geschrieben: ↑22. Jun 2018 09:32just as a heads up: in this exercise you will most likely produce code that is not accepted by the parses of IDEs(at least IntelliJ), but by the scala compiler.
So maybe you should try compiling your solution with sbt or scalac directly before dismissing it.