fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Question: naming of control classes

Question: naming of control classes 08 Aug 2018 19:38 #5774

  • FFF's Avatar

  • FFF


  • Posts: 919
  • Well, would say, a lot depends on the available intellisense possibilities. But I'm with W., it's a Pita if you always have to look for the using statements to see, what's in use.

    K.
    Regards
    Karl (X# 2.4a; Xide 1.25; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Question: naming of control classes 08 Aug 2018 21:03 #5775

  • SHirsch's Avatar

  • SHirsch


  • Posts: 163
  • Hi,

    I also prefer prefix.
    In my framework all classes are prefixed 'kd' and postfixed with their special purpose (eg. kdSleWeight oder kdSleDate).

    Stefan

    Please Log in or Create an account to join the conversation.

    Question: naming of control classes 09 Aug 2018 09:00 #5779

  • MathiasHakansson's Avatar

  • MathiasHakansson


  • Posts: 50
  • An alternative could be to organize you namespaces so that you don't have to be afraid of them...

    Accessing a Control by

    XST.SLE.Date
    XST.SLE.Password
    XST.Combo.Check
    XST.Combo.MultiSelect

    It can be better to use namespaces instead of adding prefixes. If the names are short your code does not look ugly.

    /Mathias

    Please Log in or Create an account to join the conversation.

    Question: naming of control classes 09 Aug 2018 09:05 #5780

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2232
  • Hi Mathias,

    thank you very much for your suggestion!

    Personally, I don't like to subdivide namespaces too much.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Question: naming of control classes 09 Aug 2018 13:04 #5786

  • Terry's Avatar

  • Terry


  • Posts: 176
  • Hi Wolfgang
    I think I’ve found where the confusion occurred.

    In your original question you gave the following example:
    Example: the tools version of the TextBox class could be named TextBoxXST, or XstTextBox.
    I took this to mean that you were proposing an XstTextBox which could be either a WinForms Text Box or a WPF TextBox. Letting logic sort out which was which.
    My point was that WPF controls and WinForms controls fall logically into separate namespaces anyway, so what not use them separately. Why bring them together under a single class name?

    Sorry if I’ve confused things.
    Terry

    Please Log in or Create an account to join the conversation.

    Question: naming of control classes 09 Aug 2018 20:12 #5789

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2232
  • Hi Terry,

    I would follow what Microsoft did.
    Unfortunately there are some controls with the same class name in both WPF and Windows Forms, but since you will probably not mix WinForms and WPF controls in the same window, this should be no major problem.

    We will have a xsharp.tools.WPF.xstButton class and a xsharp.tools.windows.forms.xstButton class.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    • 2
    Moderators: wriedmann