Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: two questions concerning Max's DVD-store

 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have split my questions in two threads because otherwise it might be misleading.
I have twoquestions concerning Max' DVD-store:
a)for the GUIController - class and the DVDMainWindow class, the inner class of MainWindow, Max creates two constructors: one no-arg and one with arguments? Why? Because he uses only one constructor, so I'm just a little bit confused concerning the sense of the second one. Is this only an enlargement to simplify future use of this class or belongs the declaration of two constructors within the MVC to a certain contract? Does it mean I have also to create two constructors?
b)and a second question similar to the previous: at the GUIController-class, Max has two methods:

Why does he declare here also the getConnectionType()-method although he doesn't use it. It is also a kind of contract for setters and getters-methods?
Thank you very much for your patience
Ulrich
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulrich,
1.) He just provided two oppurtinities to set the connection mode: one with C-tor and another one with setConnectionType.
2.) I just think he tried to make the sample application as most generic as possible. So, there are some method, which are not used, but which can be usefull in the future.
Best,
Vlad
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vlad,
thanks a lot for your help.
2.I just think he tried to make the sample application as most generic as possible. So, there are some method, which are not used, but which can be usefull in the future.

Now it's clear, thanks
1.) He just provided two oppurtinities to set the connection mode: one with C-tor and another one with setConnectionType.

But I haven't really understand why Max has still in many classes besides a constructor with arguments one no-arg constructor (Not only in GUIController, but in each class where he defines a arg-constructor.
Is this recommendable due to the fact that once we declare a constructor, the default no-arg constructor is not provided anymore?
Regards
Ulrich
[ December 05, 2003: Message edited by: Ulrich Heeger ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic