-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIObjectContainer.cs
More file actions
73 lines (69 loc) · 3 KB
/
IObjectContainer.cs
File metadata and controls
73 lines (69 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using RapidField.SolidInstruments.Core;
using System;
using System.Collections.Generic;
namespace RapidField.SolidInstruments.ObjectComposition
{
/// <summary>
/// Manages object creation, storage, resolution and disposal for a related group of object instances.
/// </summary>
public interface IObjectContainer : IInstrument
{
/// <summary>
/// Returns the instance of specified type that is managed by the current <see cref="IObjectContainer" />.
/// </summary>
/// <typeparam name="T">
/// The type of the instance to return.
/// </typeparam>
/// <returns>
/// The instance of specified type that is managed by the current <see cref="IObjectContainer" />.
/// </returns>
/// <exception cref="ArgumentException">
/// <typeparamref name="T" /> is not a supported type for the group.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
/// <exception cref="ObjectProductionException">
/// An exception was raised during object production.
/// </exception>
public T Get<T>()
where T : class;
/// <summary>
/// Returns a new instance of specified type that is managed by the current <see cref="IObjectContainer" />.
/// </summary>
/// <remarks>
/// <see cref="GetNew{T}" /> differs from <see cref="Get{T}" /> in that it returns a distinct instance for every subsequent
/// call.
/// </remarks>
/// <typeparam name="T">
/// The type of the instance to return.
/// </typeparam>
/// <returns>
/// The instance of specified type that is managed by the current <see cref="IObjectContainer" />.
/// </returns>
/// <exception cref="ArgumentException">
/// <typeparamref name="T" /> is not a supported type for the group.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
/// <exception cref="ObjectProductionException">
/// An exception was raised during object production.
/// </exception>
public T GetNew<T>()
where T : class;
/// <summary>
/// Gets the types of the instances that are managed by the current <see cref="IObjectContainer" />.
/// </summary>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public IEnumerable<Type> InstanceTypes
{
get;
}
}
}