• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how many instance variable and methods?

 
kshitij kaushik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys suppose I make an application having thirty or more classes.....and after some months I want to update something in that application......how can I know that how many & what are the instance variable and methods a particular class have....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I know that how many & what are the instance variable and methods a particular class have....

If you made the application, you have the source code, haven't you ?
 
kshitij kaushik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya I have..... but do I need to check whole application again to see how many Instance variable and methods a particular class have....while just by the name of class, I know that I need to update this particular class only....isn't a wasting of time to see whole application again to just update a single class...This is a hypothetical condition, am asking....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I'm still unsure what you're asking for. I guess you're talking about refactoring a class. Modern IDEs allow you to rename or move instance fields, and automatically check and update places where the refactored entity is being used. These IDEs also allow to look where a particular variable or method is used in the whole project.
 
kshitij kaushik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose their is a application having so many classes(let it be 30). having lots of interface classes and a superclass...now say class 28 is very specific in its work.......this class 28 can have some methods and instance variable from its superclasses and interfaces together with its own.....now I want to update little bit in this class 28......but since we are not sure what are the instance variable and methods it is inheriting from whole design we are susceptible to make mistake any time in updating that.......So mine question is that can some how we can know what are the methods and instance variable this class 28 is inheriting.......so that we would sure in updating class 28 that we are not making any mistake and it will helpful too at the same time.....
hope you got mine point....
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kshitij kaushik wrote: ...but since we are not sure what are the instance variable and methods it is inheriting from whole design we are susceptible to make mistake any time in updating that.......So mine question is that can some how we can know what are the methods and instance variable this class 28 is inheriting.......


How about generating javadoc for the application? Thats an additional work,but which will give you the methods/feilds etc... in detail.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a good IDE. Netbeans, Eclipse, IntelliJ, JBuilder, JDeveloper are quite helpful in navigating a project.
 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give meaningful names to the classes, methods and instances (Use java naming standards) , so that from that name itself you can figure it out what is the purpose of the perticular class, and what the method does etc. Also I think, it would be good to maintain a developer guide , which gives some idea to other coders to understand the code.
 
kshitij kaushik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok guys.........thanks a lot to all of you for your valuable suggestions........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic