473,793 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y determine
this?
Oct 12 '07 #1
3 1469
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*@discussion s.microsoft.com wrote in message
news:9E******** *************** ***********@mic rosoft.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 programmaticall y
determine
this?

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

Schneider

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:Oq******** ******@TK2MSFTN GP02.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*@discussion s.microsoft.com wrote in message
news:9E******** *************** ***********@mic rosoft.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 programmaticall y
determine
this?


Oct 13 '07 #3
On Fri, 12 Oct 2007 11:01:00 -0700, GSS
<GS*@discussion s.microsoft.com 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 programmaticall y 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
4539
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
2692
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 completed, for all declarations of that type, by ^^^ # declaring the same structure or union tag with its defining # content later in the same scope. ^^^^^ (6.2.5#23)
0
1778
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 is that the WSDL is defined incorrectly and .NET cannot parse the types. Any help is greatly appreciated! CustDDGSvc ws = new CustDDGSvc(); ws.Url = "http://dmapfra003.decisionone.com:8080/JISOAP/CustDDGSvc"; // don't understand why the...
1
8709
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 Framework are said to have an element type. http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html
669
26235
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 paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
3
2830
by: john | last post by:
Hi to All To demonstrate: public class MyBaseGenericClass<T> { } public class MyGenericClass1<T: MyBaseGenericClass<T> {
7
7818
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}" As far as I know yet -- hence this question -- there is no 'one solution fits all', but instead there are several parts that have to be put together to check. What I have so far is, and would like as much feedback as possible to ensure I've...
9
3878
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 vargraphic input parameters along the following lines in i_vargraphic100 vargraphic(100) and they are populated from String's in java.
5
3176
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 instance is created by "calling" a class object.
3
17129
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 the service using client stub, I get this error... Exception in thread "main" java.lang.Error: Unresolved compilation problems: org.apache cannot be resolved to a type org.apache cannot be resolved to a type org.apache cannot be resolved to a...
0
9670
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.