473,796 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Smart Service Model?

Oh Great Gurus... The wisdom of DotNet-dom is needed...

We have several applications in our test lab, that do not need peak
performance, but consistent reporting. We have been using C# and VB
..NET because of the ease of use.

However, each application has a significant percentage of code that is
replicated in each application... true it is assembly based and not a
big deal to include, but there must be a better way. We have our own
custom trace-listener, that has a file-pipe, event-log-pipe,
console-pipe, etc. Not managed on Microsoft's applicable block model,
but similar in concept. Since we always use the same providers we do
not need a plug-able provider model like Microsoft has established.

Now for the real question... If we take our core custom
trace-listener, and convert it from a group of assemblies that is
embedded/linked in each application 'so-to-speak' and convert the
engine that drives the trace-listener to a serivce, what special
consideration should we take into account?

Again, the overhead of the service is not an issue per se for us. Here
are the basic questions we have...

1) If the service has nothing to do, should be pause and resume it as
needed, or stop and start it? I would think pause and resume would
work best, where if the trace message queue is empy we pause, and when
ever we enqueue a message to the trace listener queue we resume it as
needed? Does a thread.sleep command do the same thing as a pause? for
the length of the sleep duration?

2) if the service has something to do, how long do we let the service
process queue items? Is there any advantage to let the service
process, cache every 100 messages, and then resume? Or even if the
queue is not empty, force the service to pause?

I suspect that this idea is similar in concept to those that have an
I/O based service say a TCP listener or something to the same effect?
Any and all suggestions welcome.

Jul 21 '05 #1
3 1657
Sounds like you want to head towards service oriented architecture.

I am concerned, however, that what you've described isn't a service. taking
input from an application and displaying some of it on the console isn't
suitable for service code, because the service, by definition, runs in a
different address space (and usually a different user space) and therefore,
doesn't share the desktop. If you just want to install common code, you can
place assemblies in the GAC and your apps can refer to them without
including them in the install.

On the other hand, I agree that an audit and logging service is a shared
module that can easily be extended to a service. As long as your messages
are going to a message store (configurable or not), you have a pathway, and
with a pathway, you can create a service.

OK... so you asked about a windows service. That's surprising to me.

If you use a web service, then all of the work is already done for you. A
web service runs as a service (IIS), listens on a port (any port you want),
manages security (web.config <identity>) and gives you full programmatic
control. If you are concerned about illegal access, then implement WSE (Web
service extensions) that will keep unauthorized apps from posting to your
service. (if you were rolling your own, you'd have to write 100% of this by
yourself).

There is no reason whatsoever to re-invent this wheel.

I have created a number of web services to be used in common by my apps.
This works remarkably well. Something to consider.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Blitz Krieg" <Sc*******@DSLE xtreme.COM> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Oh Great Gurus... The wisdom of DotNet-dom is needed...

We have several applications in our test lab, that do not need peak
performance, but consistent reporting. We have been using C# and VB
.NET because of the ease of use.

However, each application has a significant percentage of code that is
replicated in each application... true it is assembly based and not a
big deal to include, but there must be a better way. We have our own
custom trace-listener, that has a file-pipe, event-log-pipe,
console-pipe, etc. Not managed on Microsoft's applicable block model,
but similar in concept. Since we always use the same providers we do
not need a plug-able provider model like Microsoft has established.

Now for the real question... If we take our core custom
trace-listener, and convert it from a group of assemblies that is
embedded/linked in each application 'so-to-speak' and convert the
engine that drives the trace-listener to a serivce, what special
consideration should we take into account?

Again, the overhead of the service is not an issue per se for us. Here
are the basic questions we have...

1) If the service has nothing to do, should be pause and resume it as
needed, or stop and start it? I would think pause and resume would
work best, where if the trace message queue is empy we pause, and when
ever we enqueue a message to the trace listener queue we resume it as
needed? Does a thread.sleep command do the same thing as a pause? for
the length of the sleep duration?

2) if the service has something to do, how long do we let the service
process queue items? Is there any advantage to let the service
process, cache every 100 messages, and then resume? Or even if the
queue is not empty, force the service to pause?

I suspect that this idea is similar in concept to those that have an
I/O based service say a TCP listener or something to the same effect?
Any and all suggestions welcome.

Jul 21 '05 #2
You points are well taken, in that console is interactive, and not 'as'
supportable for a service per se. However, that point aside, web
services are not an option for us. We have a restrictive enviornment
that does not allow 'web' anything. I could spend hours in
explanation, but it would not change the fact that no web components or
aspects are allowed. Not the first time this issue has been asked of.

As for coding ourselves, we have everything done, but the service shell
its-self because our entire trace-listener engine is already done and
established as sat. assemblies. About the only thing I have not done
is work-up a few .NET remoting examples to get a handle on interprocess
communication locked into my mindset. Of cource, we could also setup a
singleton process that runs a low priority that acts as a clearing
house for trace messages for any given application that may need to
generate a trace message, etc. But such a process, is in point of fact
a service, in all but name.

Jul 21 '05 #3
well, if you can't go web (sounds like that decision has some painful
history... I won't go there)...
There is nothing wrong with going to remoting. Using the ability to create
a singleton object, you still won't need to run it as a windows service.

The best resource I've found for .Net remoting is a book by Ingo Rammer
called Advanced .Net Remoting. It will have you writing remoting objects
before you are done with chapter 2, with extensive sections on advanced
topics. Truly a fantastic book, and it sounds like it may suit your needs.

If you really need to stay with windows services, and you don't want to go
the remoting path, then I'd recommend using MSMQ. You send a queued audit
message to the logging component and let the logging component figure out
what to do with it. Nice thing about this: if the service isn't running,
nothing is blocked and nothing is lost.

Hope this helps,
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Blitz Krieg" <Sc*******@DSLE xtreme.COM> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
You points are well taken, in that console is interactive, and not 'as'
supportable for a service per se. However, that point aside, web
services are not an option for us. We have a restrictive enviornment
that does not allow 'web' anything. I could spend hours in
explanation, but it would not change the fact that no web components or
aspects are allowed. Not the first time this issue has been asked of.

As for coding ourselves, we have everything done, but the service shell
its-self because our entire trace-listener engine is already done and
established as sat. assemblies. About the only thing I have not done
is work-up a few .NET remoting examples to get a handle on interprocess
communication locked into my mindset. Of cource, we could also setup a
singleton process that runs a low priority that acts as a clearing
house for trace messages for any given application that may need to
generate a trace message, etc. But such a process, is in point of fact
a service, in all but name.

Jul 21 '05 #4

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

Similar topics

0
1515
by: Fritz Bosch | last post by:
We are in the process of refactoring our GUI-based test application for radio equipment and are rewriting a significant part in Python. The new architecture will substantially be based on the model-view-controller pattern, as follows: User Input | v +-------------+ service request service request +-------------+
27
3413
by: Susan Baker | last post by:
Hi, I'm just reading about smart pointers.. I have some existing C code that I would like to provide wrapper classes for. Specifically, I would like to provide wrappers for two stucts defined as ff: typedef struct { float *data ; int count ;
9
1683
by: MaSTeR | last post by:
I want to stream data from a server, the client is a smart client it I want to be able to connect to a pc (eventually the pc it's been downloaded from). The problem as you might expect is that the smart client doesn't have enough permissions to open a socket, use remoting or even call a web service. Anyone knows what to do ? (using caspol to loosen security works of course, but it is not an option)
3
268
by: Blitz Krieg | last post by:
Oh Great Gurus... The wisdom of DotNet-dom is needed... We have several applications in our test lab, that do not need peak performance, but consistent reporting. We have been using C# and VB ..NET because of the ease of use. However, each application has a significant percentage of code that is replicated in each application... true it is assembly based and not a big deal to include, but there must be a better way. We have our own...
2
2406
by: Jeff | last post by:
Please note this is NOT a rant or complaint! And yes, I'm over-simplifying, but intentionally. Here goes... With ASP.NET Web applications I like that I can access data from anywhere without installing anything on the client (but I hate HTML and markup in general and it's limitations, the request/response model, state management, etc). AFAIK, Smart apps or smart clients or whatever we call them are simply variations of Web applications...
0
2057
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the corresponding Web Reference to the Web Site project I get the error listed below. I am able to create other Web Services on the same server and I am able to add Web Referneces to them. I have narrowed it down to the "Imports System.Data.SqlClient"...
59
5147
by: MotoK | last post by:
Hi Experts, I've just joined this group and want to know something: Is there something similar to smart pointers in C or something to prevent memory leakages in C programs. Regards MotoK
11
2321
by: sunil | last post by:
Dear All, I have created a .Net service in 2.0 and running it on a machine that has a Quad Processor. It is failing with the following error. "Error 1053: The service did not respond to the start or control request in a timely fashion" This is what I saw in event Viewer. Timeout (30000 milliseconds) waiting for the MyService Server service to connect.
3
6628
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
0
9685
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10239
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...
0
10019
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9057
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 project—planning, coding, testing, and deployment—without 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
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
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...
1
4122
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
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.