Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: Decmompilers.. Pin
David Stone7-Oct-03 17:40
sitebuilderDavid Stone7-Oct-03 17:40 
GeneralRe: Decmompilers.. Pin
J. Dunlap7-Oct-03 17:50
J. Dunlap7-Oct-03 17:50 
GeneralRe: Decmompilers.. Pin
David Stone8-Oct-03 4:40
sitebuilderDavid Stone8-Oct-03 4:40 
GeneralRe: Decmompilers.. Pin
exalien8-Oct-03 5:23
exalien8-Oct-03 5:23 
GeneralRe: Decmompilers.. Pin
David Stone8-Oct-03 21:13
sitebuilderDavid Stone8-Oct-03 21:13 
GeneralDiagrams in .NET Pin
cemlouis7-Oct-03 12:17
cemlouis7-Oct-03 12:17 
GeneralRe: Diagrams in .NET Pin
Patrick Lassalle8-Oct-03 3:47
Patrick Lassalle8-Oct-03 3:47 
GeneralForm adapters, OO style question Pin
Jodokos7-Oct-03 9:52
Jodokos7-Oct-03 9:52 
Hello!

First of all:
Please correct me if I'm wrong, the following represents my opinion, I'm not perfect in OO and c# programming, so I want good arguments against or for it, to make a clear decision at the end (and of course learn something from that!) Smile | :)

I'm to contribute to a "not-so-small" c# project and the problem is that I can't come on to one of the conventions:

Forms are designed as normal with clicking, BUT (for the argument of separating design from functionality which I can't support in this case), there exists an additional class (and file) for each form, an adapter.

For example:
------------
The form frmMain is designed and in the constructor is the following statement:

_frmAdapter = new frmMainAdapter( this );

and in the adapters constructor:

frmMainAdapter( frmMain frm )
{
_frm = frm;
}

So far ok, but now are ALL used members (for example text boxes etc.) are declared as internal.
example:

previously:
-----------
private System.Windows.Forms.Button btnOK;

becomes:
--------
internal System.Windows.Forms.Button btnOK;

to be accessible from within the adapter.

If I want to, for example, add an event handler, I have to do the following in the adapter:

_frm.btnOK.Click += new EventHandler(btnOK_Click);
//That btnOK_Click is a method within the adapter.

Now my opinion:
---------------
I find that design highly disturbing and wrong, because the changes to "internal" violates a lot of the idea of accession levels in classes (in this case) and since only the adapter needs access from the outside, the whole thing becomes some kind of "psychological friend class" (hope you understand what I mean).
Now I cant check what functions will be executed and which events are associated with the controls in the form, because everything is moved into the adapter. So some features of the IDE are also eliminated with that.
Sure, one can argue for separating design from functionality, but in this case (can anyone strengthen this argument??) - C# forms - design is a part of functionality (at least I think so...) and it makes no sense to make such a separation.

Those are my two arguments against that design, can anyone proof that? or make arguments for such a design? add some more arguments for or against? Is it generally a bad design or only in this case? or only in this case not?

I'm eagerly waiting for your answers!!!

Thank You
JosefS
GeneralRe: Form adapters, OO style question Pin
panmanphil7-Oct-03 16:47
panmanphil7-Oct-03 16:47 
GeneralCustom Exceptions in Remoting Pin
mszulman7-Oct-03 9:31
sussmszulman7-Oct-03 9:31 
GeneralRe: Custom Exceptions in Remoting Pin
C LaMorticella27-Sep-04 8:26
C LaMorticella27-Sep-04 8:26 
GeneralOnPaint override in RichTextBox Pin
Judah Gabriel Himango7-Oct-03 8:38
sponsorJudah Gabriel Himango7-Oct-03 8:38 
GeneralRe: OnPaint override in RichTextBox Pin
Guillermo Rivero7-Oct-03 13:39
Guillermo Rivero7-Oct-03 13:39 
GeneralIntellisense bug Pin
Judah Gabriel Himango7-Oct-03 5:51
sponsorJudah Gabriel Himango7-Oct-03 5:51 
GeneralRe: Intellisense bug Pin
leppie7-Oct-03 7:47
leppie7-Oct-03 7:47 
GeneralRe: Intellisense bug Pin
Judah Gabriel Himango7-Oct-03 8:15
sponsorJudah Gabriel Himango7-Oct-03 8:15 
GeneralTiming Code Execution Pin
Donald_a7-Oct-03 5:09
Donald_a7-Oct-03 5:09 
GeneralRe: Timing Code Execution Pin
leppie7-Oct-03 7:51
leppie7-Oct-03 7:51 
GeneralRe: Timing Code Execution Pin
Joe Woodbury7-Oct-03 12:23
professionalJoe Woodbury7-Oct-03 12:23 
GeneralRe: Timing Code Execution Pin
Jeremy Kimball7-Oct-03 13:14
Jeremy Kimball7-Oct-03 13:14 
GeneralRe: Timing Code Execution Pin
Donald_a7-Oct-03 22:00
Donald_a7-Oct-03 22:00 
GeneralRe: Timing Code Execution Pin
Uwe Keim7-Oct-03 23:01
sitebuilderUwe Keim7-Oct-03 23:01 
Generalusing C# and DirectX Pin
flodpanter7-Oct-03 1:57
flodpanter7-Oct-03 1:57 
GeneralRe: using C# and DirectX Pin
Judah Gabriel Himango7-Oct-03 8:19
sponsorJudah Gabriel Himango7-Oct-03 8:19 
GeneralCombobox update doesn't work ... Pin
ecopilot6-Oct-03 22:30
ecopilot6-Oct-03 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.