473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

app type

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?
Oct 12 '07 #1
3 1453
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" <GS*@discussions.microsoft.comwrote in message
news:9E**********************************@microsof t.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?

Oct 12 '07 #2
You could have the application notify your component what type of app it is.

Schneider

"Kevin Spencer" <un**********@nothinks.comwrote in message
news:Oq**************@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" <GS*@discussions.microsoft.comwrote in message
news:9E**********************************@microsof t.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?


Oct 13 '07 #3
On Fri, 12 Oct 2007 11:01:00 -0700, GSS
<GS*@discussions.microsoft.comwrote:
>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
Oct 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
6
by: S.Tobias | last post by:
I'm trying to understand how structure type completion works. # A structure or union type of unknown # content (as described in 6.7.2.3) is an incomplete type. It # is ...
0
by: Chris Fink | last post by:
When I am consuming a webservice, an object has an undefined value (inq3Type.Call3Data). I do not completely understand why this is happening and apologize for the vague question. My assumption...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
3
by: john | last post by:
Hi to All To demonstrate: public class MyBaseGenericClass<T> { } public class MyGenericClass1<T: MyBaseGenericClass<T> {
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
9
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
5
by: JH | last post by:
Hi I found that a type/class are both a subclass and a instance of base type "object". It conflicts to my understanding that: 1.) a type/class object is created from class statement 2.) a...
3
by: amanjsingh | last post by:
Hi, I am trying to implement Java Web Service using Apache Axis2 and Eclipse as a tool. I have created the basic code and deployed the service using various eclipse plugin but when I try to invoke...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.