Test object type

2006-05-08 Thread Joelle Tegwen
I have a User.cfc, Manager.cfc and Worker.cfc. Manager and Worker extend User. I would like to be able to test whether an instantiated object is a Worker or a Manager. Something like cfif isObjectType(#session.currentUser#, #ttComponents.Manager#) But I don't know what isObjectType is really

RE: Test object type

2006-05-08 Thread Jim
PROTECTED] Sent: 08 May 2006 17:38 To: CF-Talk Subject: Test object type I have a User.cfc, Manager.cfc and Worker.cfc. Manager and Worker extend User. I would like to be able to test whether an instantiated object is a Worker or a Manager. Something like cfif isObjectType(#session.currentUser

RE: Test object type

2006-05-08 Thread Ben Nadel
www.bennadel.com -Original Message- From: Joelle Tegwen [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 12:38 PM To: CF-Talk Subject: Test object type I have a User.cfc, Manager.cfc and Worker.cfc. Manager and Worker extend User. I would like to be able to test whether an instantiated

RE: Test object type

2006-05-08 Thread Brad Wood
you have now, because you don't know what class you used to instantiate that object. ~Brad -Original Message- From: Joelle Tegwen [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 11:38 AM To: CF-Talk Subject: Test object type I have a User.cfc, Manager.cfc and Worker.cfc. Manager

RE: Test object type

2006-05-08 Thread Dave Watts
So I assume that you use session.currentUser to hold EITHER a manager object OR a worker object. This may be a stupid question since I don't have a lot of oop experience, but is it bad form to use the same variable name to store two different types of objects? That seems so create

RE: Test object type

2006-05-08 Thread Brad Wood
- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 12:22 PM To: CF-Talk Subject: RE: Test object type So I assume that you use session.currentUser to hold EITHER a manager object OR a worker object. This may be a stupid question since I don't have a lot of oop

RE: Test object type

2006-05-08 Thread Ian Skinner
Also, can you create an interface with CFC's, and then implement that interface with another class? (Like other OOP languages) ~Brad No not directly. See the writings of Hal Helms and others on why this is not so good for CF. -- Ian Skinner Web Programmer BloodSource

RE: Test object type

2006-05-08 Thread Dave Watts
Ok, that makes sense. So is there an instanceof method in CF or something similar to tell you what class was used to create your object. You can use GetMetaData() to find this out. Also, can you create an interface with CFC's, and then implement that interface with another class? (Like

RE: Test object type

2006-05-08 Thread Phillip Holmes
. Holmes http://phillipholmes.com === -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 12:22 PM To: CF-Talk Subject: RE: Test object type So I assume that you use session.currentUser to hold EITHER a manager object