At 04:05 PM 7/10/2002 -0400, you wrote:
>I have written a component called Department that contains functions for
>inserting, editing, deleting department information.
>
>I have begun to write a component called Audit Trail that will be used to
>log all of the user's actions.
>
>Which would you do to implement the audit?  Lets assume that I am editing a
>department...
>
>1) In the calling page first call the department.edit() method of the
>department component directly followed by the auditTrail.log() method of the
>audit trail.
>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.

  Either one is functional.  It depends on what you are trying to do.  Do 
you want to "log" every single time you use the edit (Insert / Delete) 
functions?  If so, then write the code directly into the department 
component.  Does "AuditTrail" have any function other than logging actions 
in department?  If not, there is probably no need for it to be a separate 
component.  Perhaps it could be a private method inside the department 
component?


>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?

  If you truly want to apply OO concepts to your design, you may want to 
look into picking up an Object Oriented design book.  If you can find one 
that is language independent, it would probably be more beneficial than a 
language-driven book.

   I saw Ray mentioned the possibility of inheriting the auditTrail CFC in 
the department CFC.  That is probably not an OO solution, since a 
"department" is not an "auditTrail".  This would be an is-a relationship, 
and is usually implemented using inheritance.

   A department has an audit trail, though.  This is a has-a relationship, 
which is usually implemented using properties.  You could make a property 
with the type being "auditTrail".  However, I am unclear as to how you 
would access methods of "auditTrail" via the property of department.  ( if 
that makes sense).




--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Phone: 1-203-379-0773
--
My CFMX Book: 
<http://www.amazon.com/exec/obidos/ASIN/0072225564/instantcoldfu-20>
My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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

Reply via email to