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.
Question: naming of control classes
Moderator: wriedmann
Question: naming of control classes
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Question: naming of control classes
Hi,
I also prefer prefix.
In my framework all classes are prefixed 'kd' and postfixed with their special purpose (eg. kdSleWeight oder kdSleDate).
Stefan
I also prefer prefix.
In my framework all classes are prefixed 'kd' and postfixed with their special purpose (eg. kdSleWeight oder kdSleDate).
Stefan
-
- Posts: 50
- Joined: Fri Feb 16, 2018 7:52 am
Question: naming of control classes
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
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
Question: naming of control classes
Hi Mathias,
thank you very much for your suggestion!
Personally, I don't like to subdivide namespaces too much.
Wolfgang
thank you very much for your suggestion!
Personally, I don't like to subdivide namespaces too much.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Question: naming of control classes
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
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
Question: naming of control classes
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
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
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it