Service Container C#

Good Essays
Service Container
Presented by: Anton Cherkasov
Service Providers
§ Services are the basic building blocks of the .NET design-time architecture. They help to expose access to specific features from external objects.

§ Designers and components can obtain other services through the use of service providers. A.NET service provider is represented by the System.IServiceProvider interface. The interface provides a mechanism for retrieving a specific service object, given the type of object to retrieve. Here is the only member of this interface:

object GetService(Type serviceType)

This method, when overridden, will return an object that represents the specified service type. If the service provider cannot return an object of the specified type, then callers should expect the return value to be null.

IServiceContainer Interface
§ A service container allows for services to be added and removed to it. Therefore, external objects can have more control over what a service provider exposes. A service container is actually a service provider. The interface that represents a service container is System.IServiceContainer, which is derived from IServiceProvider, as shown:

public interface IServiceContainer : IServiceProvider
IServiceContainer Interface Methods
§ Here are the two methods of this interface:

AddService: This method adds the specified service to the service container. This method has four overloads. void AddService(Type serviceType, object service); void AddService(Type serviceType, ServiceCreatorCallback callback); void AddService(Type serviceType, object service, bool promote); void AddService(Type serviceType, ServiceCreatorCallback callback, bool promote);

RemoveService: This method removes the specified service from the service container. This method has two overloads. void RemoveService(Type serviceType); void RemoveService(Type serviceType, bool promote);
ServiceContainer Class
§ The .NET Framework comes with a class that is

You May Also Find These Documents Helpful

  • Better Essays

    Terminal Containers

    • 11474 Words
    • 49 Pages

    INTRODUCTION A container terminal is a facility where cargo containers are transshipped between different transport vehicles, for onward transportation. The transshipment may be between ships and land vehicles, for example trains or trucks, in which case the terminal is described as a maritime container terminal. Alternatively the transshipment may be between land vehicles, typically between train and truck, in which case the terminal is described as an inland container terminal. Maritime…

    • 11474 Words
    • 49 Pages
    Better Essays
  • Good Essays

    The Container Store

    • 518 Words
    • 3 Pages

    The Container Store • What motivational strategies does The Container Store use to keep employees productive and satisfied? The Container Store principally uses the Maslow hierarchy of needs, this theory talks about of an arrangement of five basic needs (physiological, safety, social, esteem and self-actualization needs) that motivate behavior. (Jones & George, 2007, pp. 330). 1) Physiological Needs: The Container Store looks for satisfy this need in proving employees with a good wage…

    • 518 Words
    • 3 Pages
    Good Essays
  • Good Essays

    The Container Analysis

    • 590 Words
    • 3 Pages

    What better way to go to the theater then to watch a play on the stage, in the flesh of the actual actors. Clare Bayleys’s play “The Container” had a total of 28 seats for the audiance. Performed in a hot, dark, stuffy and smelly 40ft shipping container, as you watch scared annd anxiously awaiting to see if the refusges make it to the UK. Tom Raybould's sound plan makes you feel as if you are stuck in a truck moving, shocking, shivering to an unpropitious stop. The entryways, hammered and catapulted…

    • 590 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Force and Container

    • 306 Words
    • 2 Pages

    might be heavier then the container with water and clay. Apparatus: 1 small beaker (mL) 1Graduated cylinder 1 container 1 small portion of clay can Spring scale (newtons) Tap water 1 Cloth Method: First, hang the clay on the hook of the Newton spring scale. Secondly, record the measurements. Thirdly, get a container, fill it with water and put the clay in it. The water should be a little bit above the clay not completely filled. Fourthly, hang the container on the Newton spring scale…

    • 306 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Inland Container

    • 5700 Words
    • 23 Pages

    INLAND CONTAINER DEPORTS (ICD) PERFORMANCE/PRODUCTIVITY IN NIGERIAN ENVIRONMENT Obed B.C. Ndikom and G.C Emeghara Department of Maritime Management Technology, Federal University of Technology, Owerri ABSTRACT This paper reviews the nature, characteristics, structural operations, operational modalities and strategies for improving Inland Container Deports performance/productivity within the confines of the Nigerian Maritime Environment. Inland Container Deport is a place where containers/cargo is…

    • 5700 Words
    • 23 Pages
    Powerful Essays
  • Powerful Essays

    Stone Container

    • 2151 Words
    • 9 Pages

    Background J.H. Stone & Sons, a cardboard container and paper products manufacturer was founded by Joseph Stone in 1926 and after World War II reincorporated as Stone Container Corporation. Early on in its conception Stone was able to grow significantly by way of acquisition. The company had a policy of paying for its acquisitions either entirely in cash or borrowing funds with early repayment. Continuing to grow, the company became publicly-owned when it issued its first 250,000 shares of stock…

    • 2151 Words
    • 9 Pages
    Powerful Essays
  • Better Essays

    The Introduction of Shipping Containers Until the 1960s, shipping had not changed much in decades. Handling cargo was a labor-intensive activity, and transportation costs and times—whether by land or by sea—were huge obstacles to trade, often making transcontinental, let alone global, and trade economically unfeasible. However something happened that changed that. That was the invention of the shipping container. The birth of the shipping container dates back to April 26, 1956 when a crane lifted…

    • 1186 Words
    • 5 Pages
    Better Essays
  • Satisfactory Essays

    The Container Store-Hrm

    • 1173 Words
    • 5 Pages

    CASE: Inside the container Store [pic] Date: 31/10/2009 Dear Sir, Being assigned by you, we, are the student conducted a comprehensive study on the captioned case. We have tried heart and soul together all available information regarding the topic, which is a requirement of the MBA program. We have tried to prepare this report properly by maintaining the rules and regulations. Now, we are putting forward the report for your perusal. Your acceptance and any type of appreciation…

    • 1173 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Hr Container Store

    • 1043 Words
    • 5 Pages

    The Container Store: Introduction: Organizational structure, culture and behavior affect the people at the work. They are co-related. The structure of organization is very important because it affects on operating costs, efficiency and effectiveness of work performance, behavior and performance of employees and speed of operations of an organization. ‘Who is responsible for what’, it depends upon structure of the organization. Each of employees of the organization has capacity to be a leader…

    • 1043 Words
    • 5 Pages
    Good Essays
  • Good Essays

    and Communication Individual Assignment No 2 Case Analysis Report On ‘Pramanik Containers And The Bottleneck Challenge (A)’ Submitted by Name: Rahul Agarwal Roll No: 131246 Section: B Institute of Management, Nirma University Date of Submission: 16 August, 2014 EXECUTIVE SUMMARY Pramanik container was a family business owned by Bansilal Mehta which manufactured and supplied…

    • 1374 Words
    • 6 Pages
    Good Essays