app type
am 12.10.2007 20:01:00 von GSS
I am writing a custom logging component (which uses App Block; good stuff
there). The logger may be used in a winform, webform or in a webservice. I'd
like to determine what application type the component is being used in so I
can take different actions (e.g. terminate winapp, close session, or simply
log (or in some cases stop the service). How can I programmatically determine
this?
Re: app type
am 12.10.2007 23:39:50 von Kevin Spencer
You really don't want to build a dependency into the component that is
dependent on the application using it. Think of a reusable component as a
service. The service doesn't know about the client, but the client knows how
to use the service. The app should make the determination about what to do
if the login fails.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"GSS" wrote in message
news:9EEB3491-F289-4FAC-93C0-BD8CDBFDDF89@microsoft.com...
>I am writing a custom logging component (which uses App Block; good stuff
> there). The logger may be used in a winform, webform or in a webservice.
> I'd
> like to determine what application type the component is being used in so
> I
> can take different actions (e.g. terminate winapp, close session, or
> simply
> log (or in some cases stop the service). How can I programmatically
> determine
> this?
Re: app type
am 13.10.2007 07:20:34 von schneider
You could have the application notify your component what type of app it is.
Schneider
"Kevin Spencer" wrote in message
news:OquKshRDIHA.1316@TK2MSFTNGP02.phx.gbl...
> You really don't want to build a dependency into the component that is
> dependent on the application using it. Think of a reusable component as a
> service. The service doesn't know about the client, but the client knows
> how to use the service. The app should make the determination about what
> to do if the login fails.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
>
> DSI PrintManager, Miradyne Component Libraries:
> http://www.miradyne.net
>
> "GSS" wrote in message
> news:9EEB3491-F289-4FAC-93C0-BD8CDBFDDF89@microsoft.com...
>>I am writing a custom logging component (which uses App Block; good stuff
>> there). The logger may be used in a winform, webform or in a webservice.
>> I'd
>> like to determine what application type the component is being used in so
>> I
>> can take different actions (e.g. terminate winapp, close session, or
>> simply
>> log (or in some cases stop the service). How can I programmatically
>> determine
>> this?
>
>
Re: app type
am 15.10.2007 19:17:55 von RAD
On Fri, 12 Oct 2007 11:01:00 -0700, GSS
wrote:
>I am writing a custom logging component (which uses App Block; good stuff
>there). The logger may be used in a winform, webform or in a webservice. I'd
>like to determine what application type the component is being used in so I
>can take different actions (e.g. terminate winapp, close session, or simply
>log (or in some cases stop the service). How can I programmatically determine
>this?
Personally I would not take this approach. The logging component
should do just that -- log. If you want additional logic based on the
application type do that separately in another component, or in the
application itself.
This way your logging component can
- Concentrate on its core function
- Be usable in scenarios that you might not think of now. If you bake
in dependencies on winforms and webservices then how easily can you
use it in a Smart Device application?
--
http://bytes.thinkersroom.com