Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition Scopes #51

Open
smudge202 opened this issue Apr 20, 2015 · 1 comment
Open

Transition Scopes #51

smudge202 opened this issue Apr 20, 2015 · 1 comment
Milestone

Comments

@smudge202
Copy link
Collaborator

One of the primary goals of Compose is to not enforce service extensions relying upon Compose, instead they can simply reference System namespace and Compose will work it's magic.

As part of the Compose.Remoting project, we have identified a potential requirement for being able to scope transitions.

That is, we need the ability to mark a block of executing code locked from transitioning (Unit of Work must be completed before transitioning). In the past, I have always argued that this should be the responsibility of an application controller which monitors units of work in whichever bespoke method the consumer requires, and ensures it only performs a transition when the work completes.

This is a nice clean way of keeping to the aforementioned Compose Goal.

However, when concurrency comes into play, things get a bit more difficult.

Given this example:

public class Consumer
{
  private readonly IDependency _dependency;
  public Consumer(IDependency dependency) { _dependency = dependency; }
  public void DoSomething() { _dependency.DoStuff(); }
}

Units of Work intentionally omitted from example for brevity

We can use standard Compose functionality to transition IDependency to any implementation we like. But what if we have two instances of Consumer? We are not able to transition just one of them. If Unit's of work were involved in the example above, any bespoke logic attempting to control transitioning around the UoW would still struggle with the concurrency issue.

Therefore, we need a means to scope transitional behaviour to specific object graphs.

@smudge202 smudge202 added this to the next milestone Apr 20, 2015
@smudge202 smudge202 modified the milestones: next, 0.1.3-beta, later May 11, 2015
@smudge202
Copy link
Collaborator Author

Need to review this after completing #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant