Exercise 10 Task 1

Mario Trageser
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 20. Jul 2013 14:28

Exercise 10 Task 1

Beitrag von Mario Trageser » 23. Jan 2018 13:36

Hi,

exercise 10 task 1 says:
"Both of the previous classes should replace their wrapped tasks in lists of tasks, e.g. in a project. Note that this is not true for the
dependency".

I understand these two scentences as follows: DependentTask should not store its wrapped tasks in a list. BillingTask should store a Project, which stores the tasks wrapped by the BillingTask. Am I right?

I also do not understand, how completionDate shuld be set. I implemented it, so that duration starts with 0 and is increased when calling addTime. completionDate is always None, unless startDate has some value and markDone was called. In this case completionDate is the startDate plus the duration. Is this, how the fields should be used? What should happen, when addTime is called, after markDone was called?

How should addTime and markDone be handeled in the case of a DependentTask? Should the remaining values of a Task be taken from the dependent, or should the DependentTask have own values for them?

What about the BillableTask?

To which value should description be set by the TaskBuilder, since it dies not provide any method for this property. Which runtime type should we return, if both setDependency and setRate were called?

Kind regards,
Mario

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: Exercise 10 Task 1

Beitrag von meichholz » 23. Jan 2018 14:24

Hi,
Mario Trageser hat geschrieben:
23. Jan 2018 13:36
"Both of the previous classes should replace their wrapped tasks in lists of tasks, e.g. in a project. Note that this is not true for the
dependency".

I understand these two scentences as follows: DependentTask should not store its wrapped tasks in a list. BillingTask should store a Project, which stores the tasks wrapped by the BillingTask. Am I right?
I updated the exercise sheet, please have a look whether it makes more sense now. If not, please let me know.
Mario Trageser hat geschrieben:
23. Jan 2018 13:36
I also do not understand, how completionDate shuld be set. I implemented it, so that duration starts with 0 and is increased when calling addTime. completionDate is always None, unless startDate has some value and markDone was called. In this case completionDate is the startDate plus the duration. Is this, how the fields should be used? What should happen, when addTime is called, after markDone was called?
completionDate should only be set after markDone is called. Please just set the time when this method is called. You do not have to modify the behavior of addTime, whether markDone is called or not.
Mario Trageser hat geschrieben:
23. Jan 2018 13:36
How should addTime and markDone be handeled in the case of a DependentTask? Should the remaining values of a Task be taken from the dependent, or should the DependentTask have own values for them?

What about the BillableTask?
DependentTask and BillableTask just add state and behavior to Task, i.e. you can in both cases use the values from the wrapped task.

Best,
Matthias

Mario Trageser
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 20. Jul 2013 14:28

Re: Exercise 10 Task 1

Beitrag von Mario Trageser » 23. Jan 2018 14:32

Thank you for updating the exercise sheet.

Am I right, that DependentTask and BillableTask do not have a project field?
Does the runtime type of the result of TaskBuilder.build matter? I.e. if we have a dependency and a rate, does it matter, whether we return a Task with the runtime type DependentTask or BillableTask?

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: Exercise 10 Task 1

Beitrag von meichholz » 23. Jan 2018 14:47

Hi,
Mario Trageser hat geschrieben:
23. Jan 2018 14:32
Am I right, that DependentTask and BillableTask do not have a project field?
Yes, you're right.
Mario Trageser hat geschrieben:
23. Jan 2018 14:32
Does the runtime type of the result of TaskBuilder.build matter? I.e. if we have a dependency and a rate, does it matter, whether we return a Task with the runtime type DependentTask or BillableTask?
No it doesn't matter.

Best,
Matthias

Mario Trageser
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 20. Jul 2013 14:28

Re: Exercise 10 Task 1

Beitrag von Mario Trageser » 23. Jan 2018 14:50

Ok, thank you.

How should a task's description be set by the TaskBuilder? The builder has no setter for this property.

meichholz
Endlosschleifenbastler
Endlosschleifenbastler
Beiträge: 167
Registriert: 30. Mär 2016 08:28

Re: Exercise 10 Task 1

Beitrag von meichholz » 23. Jan 2018 15:06

Hi,

you can just pass the description to the constructor of a task?

Best,
Matthias

Mario Trageser
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 20. Jul 2013 14:28

Re: Exercise 10 Task 1

Beitrag von Mario Trageser » 23. Jan 2018 15:28

Ah, I found it. I did not see that the TaskBuilder takes a String parameter for the description in the constructor.
Sorry

Antworten

Zurück zu „Archiv“