File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes When designing a class, how do I know ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "When designing a class, how do I know ..." Watch "When designing a class, how do I know ..." New topic

When designing a class, how do I know ...

Jay Jones

Joined: Oct 11, 2001
Posts: 14
When designing a class, how do I know the following?
(1)What fields do I need?
Are there any systematic (scientific, disciplined) ways to figure that out as opposed to the intuitive ways used by those experienced programmers?
(2)Constructors are usually for initializing the fields in a class, but I've seen constructors do far more complicated things than that, such as opening up a database, performing animation, etc. How do I know what the constructors are supposed to do when designing my class?
(3)What parameters do I need for a method? Do I decide on this first before coding the method? Or do I code the method first and then come back to fill in the method signature?
Are there any books that deal with these topics?
I have been bugged by these questions for a long time. I appreciate if you programming gurus can share with us juniors how you overcome these hurdles.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Answered this in Beginner Please do not cross post.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: When designing a class, how do I know ...
It's not a secret anymore!