[dba-VB] C# Scope

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Sat Nov 5 14:47:18 CDT 2011


John --

With manager and supervisor classes being together in other classlibrary
than RunState class you can try to use inheritance - inherit RunState by
RunState1(for manager) and RunState2(for supervisor) then use delegation...

Thank you.

--
Shamil
 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: 5 ?????? 2011 ?. 21:57
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] C# Scope

Shamil,

Either way it can't be done since RunState is a class that can potentially
be needed by the grandparent as well as the parent.  I.e. Grandparent and
parent (in my current system) each actually do have their own Runstate.  In
fact the entire objective of building the RunState class was to have a
common encapsulated functionality to program against for any process that
can be started and stopped.  Grandparent starts / stops and it starts /
stops the parent.

I am using a Manager / supervisor metaphor in the system.  the form has
three "stages", any stage can be independently running, and every stage has
its own check box to allow me to start / stop it. 
  Each stage also has its own status control for writing stage status stuff.

Each Supervisor has jobs, and every job has to go through all three stages
of processing.  Thus the form starts the manager and the manager looks for
supervisors ready to start any of the stages.  Etc.

So I have these RunStates to allow everything to be told to start and stop
and communicate what state they are in.

I can't embed the runstate into a lib with any of these other classes or I
lose the encapsulation of the RunState class.

I actually have the RunState class out in a CommonObjects class lib and the
manager and supervisor classes in the actual application.

John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 11/5/2011 2:32 PM, Shamil Salakhetdinov wrote:
> No, John, I mean a separate assembly/project with type ClassLibrary.
>
> Thank you.
>
> --
> Shamil
>
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: 5 ?????? 2011 ?. 20:12
> To: Discussion concerning Visual Basic and related programming issues.
> Subject: Re: [dba-VB] C# Scope
>
> Thanks Shamil.  When you say "class library" do you mean a container
module?
>
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it
>
> On 11/5/2011 12:56 PM, Shamil Salakhetdinov wrote:
>> John,
>>
>> If you put class runState and class myClassParent in one class 
>> library and class myGrandParent in another class library referencing 
>> the first one then the following code would be the scoping solution 
>> you're looking
> for:
_______________________________________________
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