User:Paul Clark/Whiteboard
Contents |
Whiteboard (for further developing Planned Ideas)
Network as a composite
Now I am having issues deciding how to structure the three classes above. My issue with the composite design is that since the Network class has to hold at least all the un-assigned/claimed tasks, the assigner needs to know which Doer is a network (or does it, if the assigner just assigned the task to 'home, paul, josh', that would work.), and something would need to know which Doer was the network to find out which tasks were unclaimed too. So I am pretty sure the Composite pattern is out for this case.
Network as a ???
Here the Network gets passed a task list and assignee list. It adds the task to it's list of tasks, and list of unclaimed tasks if the assignee list is empty (eerrghh). It also assigns the task to the relevant people which are also contained within the Network. This is the easiest implementation (right now) and so the one I will start with, it may ot be the best though.
Network as a Chain
Issues with this implementation include: 1) The Doers have to pass themselves to the Request as parameters, again as I have designated that the network should contain at least the unclaimed tasks, then 2) if a GUI say were to display a list of unclaimed tasks It would have to go through the chain casting or calling lots of no-ops until it found all the Networks, 3) else it would have to do some kind of call back request, which would have to know about the implementation of both Network and the class it was to call back too.
Task
- Q)All tasks must be kept somewhere – even when they are not assigned to anyone – where? A) Maybe users should be part of a network, but a network should be more than a just an aggregate of people. This way if a user creates a task but doesn't assign it to anyone, it would still be a member of the network object and will be found when the group is queried for un-assigned tasks. A) Maybe a network should just be a type of doer, but when executing a task it just puts it into the unclaimed tasks list? But then how does the task get assigned to someone? Maybe the class which gives the task to the network searches through the user list looking for the user who the task was assigned to. But since the user list is stored in the network then the assigning class needs to know that there is a difference between a network and a person, and which doer is a network and not a person. So there is no point using composite at all because the points always need to go to an individual person.
- Q) More than one person can have a task, what does this mean for the Person.execute() method? – A) When the task is created (and/or later, maybe by a group op) it should be created as a x person task with y points per person (or as a task worth x payouts of y, this would be analogous to a multistage task, harking back to the %done field of traditional PIM apps ). Each person has to execute it or maybe it should be executed x times, no matter who by. The second option is probably more correct because a task shouldn't know who it has been assigned to.
- The task must have some way of recording who executed it.
- A reg-exp-y based scheduler e.g.
- This event occurs at 10/03/2010 0700 hrs + i*7 days (so it repeats at the same time every week). Java's calender class should be able to handle months with weird numbers of days &c.
- Maybe a Task object could have a getSchedule method which returns a list of all the dates at which the task occurs over the specified amount of time, or a year by default.
- Also need a setWorth method set the number of points the task is worth.
- Tasks whose points increase or decrease over time e.g.
- This task is worth 120 + 50*(%theDeadline%-(today + 1 day)) points. i.e. you get 170 points if you complete the task tomorrow, 120 if you complete it on the deadline, and the points rewarded decreases linearly with time, maybe you would even get less than 120 if you completed it after the deadline. Although when it got down into negative territory it would never get completed, so maybe there would have to be a automatically applied penalty to whomever the task was assigned to after the deadline has passed.