2

I'm trying to code an implementation of Martin Fowler's recurring event calendar found here and I understand most of it but in all of his abstract classes he passed a string named eventArgs as a parameter.

For example:

class Schedule {
    public boolean isOccuring( String eventArg, Date aDate )
    public Vector dates( String eventArg, DateRange during )
    public Date nextOccurence( String eventArg, Date aDate )
}

Anyone know what it's for? Is it just filler to show that this is just pseudocode and that I should put my arguments there?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gazillion
  • 4,822
  • 11
  • 42
  • 59
  • What of it? I did that before posting the question and the only instances of eventArg are in his pseudocode. Before assuming I didn't do my homework I'd appreciate it if you made sure of it instead of deterring others from helping me. – Gazillion Mar 07 '13 at 00:19
  • khmm.. I get more hits than the part you showed us. – Karoly Horvath Mar 07 '13 at 00:37
  • I tried rereading around his pseudocode to see if he mentioned it and couldn't find anything. At one points he uses by comparing it to some random variable called "event" ala "event == eventArg" but I can't make sense of what he's trying to do. That's why I have the impression it's just filler but I'd like to make sure. – Gazillion Mar 07 '13 at 00:42
  • Okay so I think when he creates an instance of ScheduleEvent he would have you add a string sort of like event = new ScheduleEvent('myEvent') which would then be stored in the "event" variable. When you call isOccuring on the Schedule you pass the name of your event and it'll cycle through each SE object and see if they have the same name to then check if it is occuring. – Gazillion Mar 07 '13 at 00:56
  • right above it the diagram says `The schedule element sees if the event is the same and gets the temporal expression to test the date.` looks like an identifier to me. as I said, Ctrl+F.. – Karoly Horvath Mar 07 '13 at 00:56

1 Answers1

1

In your comment, you write:

Okay so I think when he creates an instance of ScheduleEvent he would have you add a string sort of like event = new ScheduleEvent('myEvent') which would then be stored in the "event" variable. When you call isOccuring on the Schedule you pass the name of your event and it'll cycle through each SE object and see if they have the same name to then check if it is occuring.

Correct. It's simply a label for the event whose recurrence you're describing with a TemporalExpression. If you wanted to integrate your implementation with arbitrary existing systems, you might even make that an Object instead of a String, and then you could pass in some Event object defined elsewhere.

Paul A. Hoadley
  • 1,518
  • 1
  • 13
  • 17