[dev] Nag_Task Class question

Kevin M. Myer kevin_myer at iu13.org
Sat Oct 22 16:25:22 PDT 2005


I started working on Nag last night, to add email notification for task 
add/mod/delete.  I thought it might be simple - just cut and paste the 
code from Kronolith, make a few variable and code changes and we end up 
with task notifications.  However, as I found out, its not quite that 
simple.  I do have it working now but wanted to try and understand why 
Nag and Kronolith differ in their code implementations.

(This is my non-programmer interpretation, so bear with me)
Kronolith has a Kronolith_Event class and you can create a 
Kronolith_Event object and this object is passed to a number of Driver 
functions.  Nag has no such class, so the equivalent Driver functions 
take a bunch of parameters instead.  So what I did is implement a 
Nag_Task class, and use the object for the notification emails.  The 
end result is the notification code is very similar to Kronolith.

What I'm wondering is if one method is "better" than the other.  
Obviously, they both work, but for apps that might need to implement 
similar methods, its currently not easy to reuse code, as I found out.  
If it was preferred to use objects, then would it make sense to convert 
Nag to use them throughout, instead of just having them available for 
ease of reusing Kronolith's notification code?  I don't know enough to 
have an opinion, except to say that it would seem to make sense to be 
consistent.

Kevin

-- 
Kevin M. Myer
Senior Systems Administrator
Lancaster-Lebanon Intermediate Unit 13  http://www.iu13.org




More information about the dev mailing list