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
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
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
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
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
-
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
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
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
. 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
9 matches
Mail list logo