> 2) In the calling page call the department.edit() method of the
department
> component. In the department component, in the edit method call the
> auditTrail.log() method.
>
This is probably your best bet.
> Of course keep in mind that I'm going to have to call the auditTrail
> component every time an insert, edit or delete action is made... Is it
> better / more oop (not that I know exactly when I'm
respecting/violating
> the
> rules of OOP as it is) to do number 1, 2 or is there some other option
I
> should be considering?
>
Well since you asked... the way to do this more OO isn't really possible
in CFMX. However, if you interested in how it would be done in Java,
then here you go.
You would create a Department class just as you described above. Instead
of creating an audit trail class you would create a Audit interface. You
would want to create an implementation of the Audit interface with a
class callded AuditTrail. Then create a new class, AuditedDepartment
that extends the Department class and implements the Audit interface.
The AuditedDeparment class would override the methods of the Department
class, but call the super class's methods and the AuditTrail's methods.
For example, the edit method might look like this.
public void edit()
{
super.edit();
auditTrail.log();
}
-Matt
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists