Results 1 to 4 of 4

Thread: class design

  1. #1
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Posts
    150
    Rep Power
    5

    Default class design

    this is not an error or code going wrong but a simple question: how do you design your layout(how many classes you are going to use, which constructors,...

    I am now on a project:reading an xml file, parsing it and start downloading (Explained simple) Is there a trick to know how many classes,... you are going to use?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    short answer, no trick.

    with having to solve problems comes the experience that allows one to expect about how many components will be in the final system, but depending on what design paradigm you follow (top down, UML, so many really), and even the level of detail used in these, the total inventory won't become apparent until the the design, and possibly the implementation has been completed.

    and for agile projects where the scope of the problem to be solved is always moving, you never are really 'done' anyway.

  3. #3
    macason is offline Member
    Join Date
    Nov 2009
    Posts
    7
    Rep Power
    0

    Default

    IMO... forget trying to define your scope at the start, use the most agile approach as you possibly can. Only define what you need too when you need too and be ready to be ruthless with your refactoring.

    Even long term coders find themselves reworking/ refactoring their code. Misconceptions and misinterpretations are a fact of life.

    Use as many classes as feels good, don't over engineer, if an object seems to be getting a bit clunking (doing too many things), get out the refactor stick and start belting it till another object falls out.

    Ultimately it really doesn't matter how many objects you use, whats more important is that when you come back to the code a year from now its obvious where you were going with it and what the intent was.

    If a method or class requires more than a 2 or 3 line comment to explain it .... get out the refactor stick again !!

  4. #4
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Posts
    150
    Rep Power
    5

    Default

    thanks for the response guys.
    I have a long method, it takes my hole screen and It has some loops in it.
    should I split or is this still considered as clean?

Similar Threads

  1. help: I want to design 2D map?
    By mofaker in forum AWT / Swing
    Replies: 4
    Last Post: 10-29-2009, 01:34 AM
  2. JSP Design.
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 04-20-2009, 02:21 PM
  3. Design question
    By kfunk in forum New To Java
    Replies: 4
    Last Post: 10-10-2008, 04:33 AM
  4. design question comments wanted - essential class init()
    By Nicholas Jordan in forum Advanced Java
    Replies: 0
    Last Post: 07-22-2008, 10:41 PM
  5. Pls HeLp Me (Design a class named Fan)
    By faw in forum Advanced Java
    Replies: 5
    Last Post: 04-21-2008, 08:25 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
  •