|
-
dynamic object identification problem
ok, I have a class that takes 3 inputs.
Variable(NAME, TYPE, DATA);
the name is a string, the type is a string, however the DATA is where it gets tricky.
DATA depends on what the string TYPE is. Example
if TYPE is a String
DATA isa String
if TYPE is a VectorObject
DATA isa VectorObject
you get the idea right?
Now, here's the problem. I don't know what to identify DATA as. It's type is determined at runtime, not compiletime, so I don't know what to define it as, since a string cannot be coverted into VectorObject, plus i can't keep redefining DATA.
Example:
if TYPE isa VectorObject
DATA isa VectorObject
would be shown as VectorObject DATA = new VectorObject();
the problem arises when i try to store or return the DATA object!
public <omg i dont know what identifier goes here, b/c i don't know the type yet> GetData { return DATA;}
There's got to be a better way to do this or something small that im missing.
like an interface.. but i dont know how to implment the interface if so....
Similar Threads
-
By chida in forum ASP.NET
Replies: 5
Last Post: 09-27-2002, 04:40 PM
-
Replies: 1
Last Post: 08-04-2002, 10:40 AM
-
By Marco Alves in forum .NET
Replies: 6
Last Post: 03-26-2002, 09:58 AM
-
By Jordan in forum ASP.NET
Replies: 2
Last Post: 10-13-2001, 02:02 AM
-
By Greg Dirst in forum authorevents.appleman
Replies: 1
Last Post: 04-10-2000, 02:56 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks