-
Newbie questions.
Basically, I've got an application with quite a few objects. These objects hold some data, but also have methods that heavily rely on the data they contain. They don't know what methods they need to call until runtime, so I currently have a series of chained if/elseif statements.
So, to recap a bit. I have Object X that has a set of variables and methods. I create new X's when necessary, and change the variables/etc for that particular instance of X. So I'm ending up with a lot of instances of X with the same variables/methods, but holding different data.
To remedy this, I've been looking into different ways Java classes are used (implements, extends, interfaces, etc). I've also been looking into Reflection to help rid myself of the if/elseif chains. I think I'm getting a better idea of how Java is really SUPPOSED to work with these (vs my newbie hack together method.) Really, I just wanted to see if I could get some input from some pros. Am I going in the right direction? Do you have any suggestions for helping to clean up my code, and help reduce the extreme amounts of overhead I'm creating due to my ignorance?
-
maybe post part/all of your code so that we may actually see what you are doing and therefore provide better help.
Similar Threads
-
By bransam in forum VB Classic
Replies: 1
Last Post: 10-06-2005, 01:23 AM
-
Replies: 1
Last Post: 12-20-2001, 11:54 AM
-
By Saiful in forum Open Source
Replies: 2
Last Post: 06-21-2001, 05:20 PM
-
By Erik in forum Enterprise
Replies: 3
Last Post: 02-01-2001, 11:22 AM
-
By Paul in forum Enterprise
Replies: 1
Last Post: 12-07-2000, 06:11 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