big class with many member methods or divide into many small classes?

Which one is better?

[27 byte] By [RucentKita] at [2007-11-27 11:42:15]
# 1

depends

Sorry thought we were just trying to be as vague as possible.

On a more serious note it does just depend on exactly what it is you are trying to achieve.

On occasions both methods would suit fine

c0demonk3ya at 2007-7-29 17:43:05 > top of Java-index,Java Essentials,Java Programming...
# 2

The cleaner and more logical one, where classes have high cohesion and low coupling.

http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29

http://en.wikipedia.org/wiki/Coupling_%28computer_science%29

BigDaddyLoveHandlesa at 2007-7-29 17:43:05 > top of Java-index,Java Essentials,Java Programming...
# 3

I'd say divide into small classes. There are legitimate times when you'd go against this, but you'd know when they were and wouldn't ask the question. If either way makes sense, choose to divide and conquer, if nothing else it means you have to read less code at any one time

georgemca at 2007-7-29 17:43:05 > top of Java-index,Java Essentials,Java Programming...
# 4

Seeing as this is the OP's first post, I say, post some sample code and then forum denizens will make fun^H^H^H^H^H^H^H give their opinions. Commenting in a vacuum is of limited value.

BigDaddyLoveHandlesa at 2007-7-29 17:43:05 > top of Java-index,Java Essentials,Java Programming...