[dba-VB] Wrapper classes

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Thu Dec 16 12:28:09 CST 2010


Hi John --

You'd better keep your code within User Custom Control in a (User Custom
Controls) class library. 
User Custom Controls can be nested or inherited - such a nesting/inheritance
rarely gets deeper than three levels. 
And even more strong assertion is true - it never gets deeper than three
levels in the projects of my customers, with one-two levels being the most
common application cases. And in the case of two levels the upper level User
Custom Control (dropped on WinForms) is usually used just as a container
(nest)

Thank you.

--
Shamil
 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: 16 ??????? 2010 ?. 19:26
To: VBA
Subject: [dba-VB] Wrapper classes

Before I get too far down this road, I need to know whether a strategy I use
is viable or there is a better way to do this.

I have a strategy that I developed back in VBA where I wrap a set of
controls required to do something along with the logic to do that something
into a class.  I sink any events for the controls in that class and raise
events as required from that class.  For example I just created a
clsGetFile.  In the constructor I pass in a button and a text box.  The text
box displays the folder that is selected and has a default "starting path".
The button creates an OpenFileDialog and allows the user to navigate to and
select a file.  The class has properties pInitialPath and pFileSpec;

I place this class in a ProjBaseObjects and reference that project from
anywhere that I need to do a filefind.

I have just started using this wrapper class paradigm in C# and just wanted
to check with our more experienced .Net developers that this strategy is
appropriate in .Net.

Thanks,
--
John W. Colby
www.ColbyConsulting.com
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list