473,395 Members | 1,756 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,395 software developers and data experts.

How to understand the role of Service?

The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.
In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time. But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Aug 6 '06 #1
6 1890
Hi,
The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.
The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.
In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.
Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.
But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.
I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware. I'm
referring to the notion that loose coupling of components is generally better.
So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.
Review design patterns and gather experience if you don't understand them.

--
Dave Sexton
Aug 6 '06 #2
Very appreciated for your detailed explanation.

Yes, I had a misunderstanding. Service pattern decouples the service
prodiver and the consumer. And the *CONTACT* is the key point which
maintains the interop between the service and the consumer.

I don't know if the following links referring to MS Provider pattern
are the desired stuffs, see,
http://msdn.microsoft.com/library/de...sp02182004.asp
http://msdn.microsoft.com/library/de...sp04212004.asp

Dave Sexton wrote:
Hi,
The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.

The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.
In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.

Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.
But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware. I'm
referring to the notion that loose coupling of components is generally better.
So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Review design patterns and gather experience if you don't understand them.

--
Dave Sexton
Aug 7 '06 #3
Hi,

Thanks for the links, but the ASP.NET provider pattern is an example of an abstract base class with configuration. I was hoping
there was documentation of a component-based design pattern, one that did not use xml configuration as a part of the solution,
named, "Provider". I guess there is none.

I assume, somewhat like that used by ASP.NET, the pattern consists of an abstract base class that is the contract being "provided",
a concrete implementation of that contract, a strong-typed collection for that contract, an abstract service class that exposes that
collection as a property and a default "provider" as a property, and a concrete implementation of the service class. The service
could also be an interface implementation, which is usually how services are exposed to consumers through a provider.

Sound good or have I described a different pattern altogether?

The goal of the pattern, IMO as I stated in my previous post, is to decouple a service's implementation with the mechanisms for
discovery and consumption. I guess "mechanisms" is a pretty lose term and that view, if accurate, would explain why there is no
definitive "Provider" pattern.

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11*********************@i3g2000cwc.googlegrou ps.com...
Very appreciated for your detailed explanation.

Yes, I had a misunderstanding. Service pattern decouples the service
prodiver and the consumer. And the *CONTACT* is the key point which
maintains the interop between the service and the consumer.

I don't know if the following links referring to MS Provider pattern
are the desired stuffs, see,
http://msdn.microsoft.com/library/de...sp02182004.asp
http://msdn.microsoft.com/library/de...sp04212004.asp

Dave Sexton wrote:
>Hi,
The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.

The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.
In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.

Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as
services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless
you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You
get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.
But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware.
I'm
referring to the notion that loose coupling of components is generally better.
So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Review design patterns and gather experience if you don't understand them.

--
Dave Sexton

Aug 7 '06 #4
A mechanism for discovery and consumption?
Interfaces are enough for exposing what consumers can do, then why
still need discovery?
I'm a little confused. Is it the reason that there is no real provider?
I guess.

Dave Sexton wrote:
Hi,

Thanks for the links, but the ASP.NET provider pattern is an example of an abstract base class with configuration. I was hoping
there was documentation of a component-based design pattern, one that did not use xml configuration as a part of the solution,
named, "Provider". I guess there is none.

I assume, somewhat like that used by ASP.NET, the pattern consists of an abstract base class that is the contract being "provided",
a concrete implementation of that contract, a strong-typed collection for that contract, an abstract service class that exposes that
collection as a property and a default "provider" as a property, and a concrete implementation of the service class. The service
could also be an interface implementation, which is usually how services are exposed to consumers through a provider.

Sound good or have I described a different pattern altogether?

The goal of the pattern, IMO as I stated in my previous post, is to decouple a service's implementation with the mechanisms for
discovery and consumption. I guess "mechanisms" is a pretty lose term and that view, if accurate, would explain why there is no
definitive "Provider" pattern.

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11*********************@i3g2000cwc.googlegrou ps.com...
Very appreciated for your detailed explanation.

Yes, I had a misunderstanding. Service pattern decouples the service
prodiver and the consumer. And the *CONTACT* is the key point which
maintains the interop between the service and the consumer.

I don't know if the following links referring to MS Provider pattern
are the desired stuffs, see,
http://msdn.microsoft.com/library/de...sp02182004.asp
http://msdn.microsoft.com/library/de...sp04212004.asp

Dave Sexton wrote:
Hi,

The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.

The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.

In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.

Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as
services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless
you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You
get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.

But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware.
I'm
referring to the notion that loose coupling of components is generally better.

So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Review design patterns and gather experience if you don't understand them.

--
Dave Sexton
Aug 7 '06 #5
Hi,

I see a "provider" as providing one or more services so that services can be "discovered" at runtime, instead of just directly
accessing a class that implements a service.

For instance, say that I know of a service interface that exposes methods for logging. The interface provides a loose coupling
between an implementation of logging, which can be file-based or use the event log service (another service), and the consumer.
However, as a consumer I would still need to acquire an implementation of that interface. If I know of a class named,
"EventLogService" that implements the logging service interface I could create an instance of that class, however the provider
pattern would enable a different mechanism for discovery. Using a provider I'm able to discover services at runtime based on a
specific service interface without being aware of the mechanisms for service registration, effectively decoupling the mechanisms for
discovery from registration and implementation. I no longer need to be aware of the "EventLogService" class. I just simply need to
be aware that I want to use, say, the default provider. Provider service registration, in ASP.NET 2.0, happens to use xml
configuration and a static class as the entry point for service discovery at runtime.

Does that clear it up?

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11**********************@i42g2000cwa.googlegr oups.com...
>A mechanism for discovery and consumption?
Interfaces are enough for exposing what consumers can do, then why
still need discovery?
I'm a little confused. Is it the reason that there is no real provider?
I guess.

Dave Sexton wrote:
>Hi,

Thanks for the links, but the ASP.NET provider pattern is an example of an abstract base class with configuration. I was hoping
there was documentation of a component-based design pattern, one that did not use xml configuration as a part of the solution,
named, "Provider". I guess there is none.

I assume, somewhat like that used by ASP.NET, the pattern consists of an abstract base class that is the contract being
"provided",
a concrete implementation of that contract, a strong-typed collection for that contract, an abstract service class that exposes
that
collection as a property and a default "provider" as a property, and a concrete implementation of the service class. The service
could also be an interface implementation, which is usually how services are exposed to consumers through a provider.

Sound good or have I described a different pattern altogether?

The goal of the pattern, IMO as I stated in my previous post, is to decouple a service's implementation with the mechanisms for
discovery and consumption. I guess "mechanisms" is a pretty lose term and that view, if accurate, would explain why there is no
definitive "Provider" pattern.

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11*********************@i3g2000cwc.googlegrou ps.com...
Very appreciated for your detailed explanation.

Yes, I had a misunderstanding. Service pattern decouples the service
prodiver and the consumer. And the *CONTACT* is the key point which
maintains the interop between the service and the consumer.

I don't know if the following links referring to MS Provider pattern
are the desired stuffs, see,
http://msdn.microsoft.com/library/de...sp02182004.asp
http://msdn.microsoft.com/library/de...sp04212004.asp

Dave Sexton wrote:
Hi,

The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.

The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.

In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.

Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as
services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless
you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You
get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.

But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A
service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose
coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware.
I'm
referring to the notion that loose coupling of components is generally better.

So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Review design patterns and gather experience if you don't understand them.

--
Dave Sexton

Aug 7 '06 #6
Whoa! So that it is. This makes perfect sense.
thx you very much.

Dave Sexton wrote:
Hi,

I see a "provider" as providing one or more services so that services can be "discovered" at runtime, instead of just directly
accessing a class that implements a service.

For instance, say that I know of a service interface that exposes methods for logging. The interface provides a loose coupling
between an implementation of logging, which can be file-based or use the event log service (another service), and the consumer.
However, as a consumer I would still need to acquire an implementation of that interface. If I know of a class named,
"EventLogService" that implements the logging service interface I could create an instance of that class, however the provider
pattern would enable a different mechanism for discovery. Using a provider I'm able to discover services at runtime based on a
specific service interface without being aware of the mechanisms for service registration, effectively decoupling the mechanisms for
discovery from registration and implementation. I no longer need to be aware of the "EventLogService" class. I just simply need to
be aware that I want to use, say, the default provider. Provider service registration, in ASP.NET 2.0, happens to use xml
configuration and a static class as the entry point for service discovery at runtime.

Does that clear it up?

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11**********************@i42g2000cwa.googlegr oups.com...
A mechanism for discovery and consumption?
Interfaces are enough for exposing what consumers can do, then why
still need discovery?
I'm a little confused. Is it the reason that there is no real provider?
I guess.

Dave Sexton wrote:
Hi,

Thanks for the links, but the ASP.NET provider pattern is an example of an abstract base class with configuration. I was hoping
there was documentation of a component-based design pattern, one that did not use xml configuration as a part of the solution,
named, "Provider". I guess there is none.

I assume, somewhat like that used by ASP.NET, the pattern consists of an abstract base class that is the contract being
"provided",
a concrete implementation of that contract, a strong-typed collection for that contract, an abstract service class that exposes
that
collection as a property and a default "provider" as a property, and a concrete implementation of the service class. The service
could also be an interface implementation, which is usually how services are exposed to consumers through a provider.

Sound good or have I described a different pattern altogether?

The goal of the pattern, IMO as I stated in my previous post, is to decouple a service's implementation with the mechanisms for
discovery and consumption. I guess "mechanisms" is a pretty lose term and that view, if accurate, would explain why there is no
definitive "Provider" pattern.

--
Dave Sexton

"dotNeter" <Bu************@gmail.comwrote in message news:11*********************@i3g2000cwc.googlegrou ps.com...
Very appreciated for your detailed explanation.

Yes, I had a misunderstanding. Service pattern decouples the service
prodiver and the consumer. And the *CONTACT* is the key point which
maintains the interop between the service and the consumer.

I don't know if the following links referring to MS Provider pattern
are the desired stuffs, see,
http://msdn.microsoft.com/library/de...sp02182004.asp
http://msdn.microsoft.com/library/de...sp04212004.asp

Dave Sexton wrote:
Hi,

The services, talked here, are things used in IServiceContainer,
IServiceProvider, etc.

The term "Service" and "Provider", as in IServiceProvider, refer to specific design patterns (as does "Container", which is
self-explanatory IMO).

ServiceInterface pattern:
http://patternshare.org/default.aspx...rviceInterface

The provider pattern decouples a service's implementation with the mechanisms for discovery and consumption. I can't find a
reference to this pattern on patternshare.org. Maybe someone else has links they could mention.

In my opinion, everything can be a service, and a service is generally
used for providing specific features for service consumers, at design
time.

Many things that aren't commonly referred to as services can be thought of as services, but actually referring to them as
services
would create ambiguity when used out of context. For instance, you don't normally call an object's methods, "services" unless
you
are creating a logical design. The term "service" is probably overused anyway, but here we are referring to a specific design
pattern.

You can also use these design patterns, as well as the actual interfaces, at runtime. From the perspective of the VS.NET
development team, their application uses them at runtime. You could use these patterns as well in your own applications. You
get
some basic support for services in your own applications just by deriving a class from System.ComponentModel.Component. Web
services are another example of services being consumed at runtime. There are many, many more examples.

But, I think the cnsumers must completely know all aspects of
that service. This sounds not good, and breaks the decoupling rule.

I don't think a consumer must know all aspects of a service that it consumes, otherwise it would break encapsulation. A
service
could very well implement multiple service interfaces if they must share data. The consumer need only be concerned with the
interface on which it's performing it's work.

As for breaking the "decoupling rule", I think the service pattern intends to do just the opposite by creating a loose
coupling
between the service implementation and the applications that use it, unless you are referring to a rule of which I'm unaware.
I'm
referring to the notion that loose coupling of components is generally better.

So how to understand the role of Service, in a software engineering
perspective.
Thx in advance.

Review design patterns and gather experience if you don't understand them.

--
Dave Sexton
Aug 8 '06 #7

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

Similar topics

34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
2
by: php newbie | last post by:
Hello, I am trying to load a simple tab-delimited data file to SQL Server. I created a format file to go with it, since the data file differs from the destination table in number of columns. ...
9
by: Thom Little | last post by:
I seem to (once again) be missing something pretty basic. I am running under Windows XP Professional Service Pack 1 with all Hotfixes installed and Visual Studio .NET 2003 in Debug mode. The...
5
by: Jon Skeet [C# MVP] | last post by:
I've got a web service where different methods require different roles, and I'm trying to enforce that now. I've worked out *one* way of doing things, using PrincipalPermissionAttribute - but...
2
by: Ken Varn | last post by:
I am configuring my web service with Web.config using windows authentication. I want to limit the web service permissions by using the allow / deny roles authorization. I have added the following...
2
by: Spondishy | last post by:
Hi, I'm just getting into asp.net 2 c# using the login and registration controls. I have a role called publisher and want the user adding to that role when they register and send an email to say...
3
by: Smokey Grindle | last post by:
Can you use asp.net's membership and role provider sevices inside a web service for authentication? I am trying to find a way to reduce coding.. and that seems like it would be a good fit to do...
2
by: Khafancoder | last post by:
Hi , i'm developing a permission-based win application there is one Permission for each possible Action in db & each Role has some Permissions and a custom authentication system is implemented...
2
by: Anthony Smith | last post by:
I have a user object that is set when a user logs in. There are also permissions that I get about the user from a web service. Currently I take the results from those web services and store them as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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.