DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006

    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?

  2. #2
    Join Date
    Dec 2005
    maybe post part/all of your code so that we may actually see what you are doing and therefore provide better help.

Similar Threads

  1. DateDiff questions from newbie
    By bransam in forum VB Classic
    Replies: 1
    Last Post: 10-06-2005, 01:23 AM
  2. newbie questions
    By Ramdev in forum Java
    Replies: 1
    Last Post: 12-20-2001, 11:54 AM
  3. Some Newbie Questions
    By Saiful in forum Open Source
    Replies: 2
    Last Post: 06-21-2001, 05:20 PM
  4. Newbie questions
    By Erik in forum Enterprise
    Replies: 3
    Last Post: 02-01-2001, 11:22 AM
  5. 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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.