UML Understanding problems

hi
i am facing problems in understanding some isuues in uml desiging.

  1. when i design a program i dont know exactly what do the program need to run properly . and sometimes i need to add a variable in oreder to make a certain method to work properly. the Question is how can i avoid this thing from the beginning ?
    2)i found some details in the code not to be mentioned in the uml design like if stetements and some expressions and even some methods and objects like main() and actionlistener . But i coudnt realize the fundamental of this .
    3)when i need a constructer ? i still dont understand why some programs have a constructor .You can use what ever you want of methods without constructor what is the need for constructor sometimes ?

Hi,

I think you are not really talking about UML modelling but about programming in general and
about object oriented programming.

  1. I think there is no simple solution. Modelling your system first using UML for instance
    might help you not to forget things… maybe not. It is a good question!

  2. UML models never show the specific implementations of things (methods in particular).
    It is not what they are made for.

  3. You should know that if you haven’t defined a constructor yourself there always exists a
    default constructor. The question is not whether a constructor is useful or not, a constructor
    is mandatory. It is invoked each time a class is being instanciated.

Regards.