Design Philosophy for WSH-extending ActiveX controls 
Author Message
 Design Philosophy for WSH-extending ActiveX controls

This is longish - I just want feedback from anyone who is interested in the
tools I've been working on or is willing to help keep me from falling flat on my
face with stupid mistakes... ;-)

==========================

After thinking about things for several days, seeing how code wrapping tools
tend to grow, and so forth, I'm trying to come up with a useful approach for
building extension DLLs.  I have some opinions and some questions, and I would
love feedback on all of them.

GOALS

These were my initial goals (beyond building my programming skills and
understanding of COM):

(1) Take small tasks which are not easily accessible to WSH and make them "plug
and play" on NT/2000/XP (and hopefully 9x) - uptime, reboot, etc .

(2) Make them "open source code" so people can recompile or modify for trust
purposes.  Incidentally, that means they can also be dropped into VBA as-is for
use there.

CURRENT PHILOSOPHY

Here's what I've come up with so far as an approach.

(1) Typing and exposed properties - minimalist
Cast things explicitly and hide everything except for the minimalist call and
results from the end users.  Makes obvious sense in retrospect (thanks, Mike).

(2) Structure - cellular classes
Trying to create monolithic DLLs is a mess even if it does mean that you can
cram more things into the same space. I've come to the conclusion that I should
use very small, single-function classes for a variety of reasons.
(2a) They are easier to code and debug, and easier for end users who are new to
coding to understand structurally
(2b) End users can grab an "a la carte" function to use for a special purpose
and not worry about anything else; they can also deploy per-purpose items if
necessary without worrying about something such as a security problem with an
unrelated item.
(2c) This also yields "drag and drop" class modules which can be pulled into any
VB or VBA project.

(3) Naming Schemes
This is one I'm unsure about right now.  I have 3 distinct things to deal with
for names - the library, the class, and its properties/methods/events. Consider
a 3 KiB DLL that just gives you system uptime - what do you call the library,
class, and method?
I've come up with a few possibilities; even though I hate the use of Hungarian
naming for the obvious, maybe I should use in this example
libUptime/clsUptime/Uptime - and then have
Filename: libUptime
Class: libUptime.clsUptime
Method: Uptime

An alternative (to make for easier sorting of files) is to use Hungarian postfix
names: UptimeLib,UptimeCls, Uptime.

I'm not interested in using my initials since it is open and I expect the code
to be out of my control within months if it is useful.  I can't use redundant or
identical names for the class since if anyone uses a large repository folder
there will be file collisions. VB5 also chokes on me if I try to give identical
names to library and class.



Mon, 27 Sep 2004 10:28:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Crystal InterDev Design-Time ActiveX Control

2. design-time activex control pad

3. ActiveX Control Container for VBCCE5 ActiveX Controls!?

4. adding an activex control to Wsh

5. ActiveX Controls from VBScript or WSH

6. Instancing ActiveX controls within WSH Scripts

7. ActiveX control in WSH without HTML?

8. Debug an ActiveX Control called from WSH

9. Grid design-time control - no display with no result RS

10. Grid Design-Time Control problem

11. Using a Select expression in Design time controls

12. Design time controls and frame navigation

 

 
Powered by phpBB® Forum Software