pyatcron-devel-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Pyatcron-devel-list] Cron backend: a correction


From: Julien Olivier
Subject: RE: [Pyatcron-devel-list] Cron backend: a correction
Date: Mon, 17 Nov 2003 11:21:39 +0000

On Fri, 2003-11-14 at 16:24, Childers, Matthew wrote:
> > > Ditto! : ) I'm not sure where to start...
> > >
> > > I've been reading through the code and stuff, to see how things have
> > > thus far been implemented, but I'm not sure what I should do next.
> LOL
> > 
> > I don't know if Matthew is currently working on it but we need a
> > PyAtCronTask class which will contain all the common
> properties/methods
> > for each task. Then, we need a sub-class for each task type
> > (PyAtCronTaskDownload, PyAtCronTaskCommand, PyAtCronTaskBackup
> etc...).
> > But, as I said, I think Matthew is working on it.
> 
> I am waiting on a definition of the PyAtCronTask class.  If we can
> define what variables, methods.. we want in this class, I will start
> putting it together.
> 
> Currently this is how I see it
> 
>       PyAtCronTask Class:
>               Variables:
>                       Name
>                       TaskType - subclass
>                       Schedule - subclass
>                       Active
> 
>               Methods:
>                       getName - Returns Task Name
>                       setName
>                       getActive - Returns True/False
>                       setActive
>                       getCronStatement - Returns the full cron 
>                               command using the getCommand from
>                               PyAtCronTaskType and getCronSchedule
>                               From PyAtCronSchedule.  And comments
>                               It out if it is not active.
>                       
> 
>       PyAtCronTaskType Class:  (Will be inherited by all Task Types)
>               Variables:
>                       Command
> 
>               Methods:
>                       getCommand - Returns Command Statement
>                       setCommand
> 
> 
>       PyAtCronTaskSchedule Class:
>               Variables:
>                       Minutes
>                       Hours
>                       Days
>                       Months
>                       Weekdays
> 
>               Methods:
>                       getNextRunTime - Returns Next Run Time
>                       getCronSchedule - Returns Schedule in form: 0 0
> * * 1,3,5
>                       setMinutes
>                       setHours
>                       setDays
>                       setMonths
>                       setWeekdays
>                       getMinutes
>                       getHours
>                       getDays
>                       getMonths
>                       getWeekdays
>                       
> 
> Now, again, I am not an OO programmer, so this may not be what you all
> are looking for at all, but if it is not, let me know what needs to be
> changed so I can get started setting up these classes.
> 

My problem with your hierarchy is that the TaskType should really be a
sub-class of the Task class, not a property. I think you should look at
Xavier's diagram to understand what I mean. Apart from that, it seems
pretty OK.

-- 
Julien Olivier <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]