Permalink
Browse files

Refactored Data Operations to Domain Operation.

  • Loading branch information...
Kostassoid committed May 29, 2012
1 parent f5c243c commit daa8132fb271b4e3fb640588d0ed74c3f7972acf
@@ -46,21 +46,18 @@
<Compile Include="AggregateRootChangeSet.cs" />
<Compile Include="IDataAccessProvider.cs" />
<Compile Include="IUnitOfWorkEx.cs" />
- <Compile Include="Operations\BaseDataOperation.cs" />
+ <Compile Include="Operations\BaseDomainOperation.cs" />
<Compile Include="DataSession.cs" />
<Compile Include="Exceptions\StaleDataException.cs" />
<Compile Include="Exceptions\ConcurrencyException.cs" />
<Compile Include="DataChangeSet.cs" />
<Compile Include="Events\UnitOfWorkCompletedEvent.cs" />
- <Compile Include="Operations\IDataCommand.cs" />
- <Compile Include="Operations\IDataOperation.cs" />
<Compile Include="Exceptions\AggregateRootNotFoundException.cs" />
<Compile Include="Events\UnitOfWorkRollbackEvent.cs" />
<Compile Include="IDataSession.cs" />
<Compile Include="IDataSessionEx.cs" />
<Compile Include="IDataSessionFactory.cs" />
<Compile Include="Operations\IOperationResolver.cs" />
- <Compile Include="Operations\IDataQuery.cs" />
<Compile Include="Operations\IRepository.cs" />
<Compile Include="Policy\DataAccessPolicy.cs" />
<Compile Include="Policy\StaleDataPolicy.cs" />
@@ -15,6 +15,9 @@ namespace Kostassoid.Anodyne.DataAccess
{
using Domain.Base;
using Domain.Events;
+
+ using Kostassoid.Anodyne.Domain;
+
using Operations;
using System;
using System.Collections.Generic;
@@ -50,7 +53,7 @@ public void Handle(IAggregateEvent @event)
public abstract IRepository<TRoot> GetRepository<TRoot>() where TRoot : class, IAggregateRoot;
- public TOp GetOperation<TOp>() where TOp : class, IDataOperation
+ public TOp GetOperation<TOp>() where TOp : class, IDomainOperation
{
var operation = OperationResolver.Get<TOp>();
@@ -16,6 +16,9 @@ namespace Kostassoid.Anodyne.DataAccess
{
using Domain.Base;
using Domain.Events;
+
+ using Kostassoid.Anodyne.Domain;
+
using Operations;
using Policy;
using Wiring;
@@ -24,7 +27,7 @@ namespace Kostassoid.Anodyne.DataAccess
public interface IDataSession : IDisposable, IHandlerOf<IAggregateEvent>
{
IRepository<TRoot> GetRepository<TRoot>() where TRoot : class, IAggregateRoot;
- TOp GetOperation<TOp>() where TOp : class, IDataOperation;
+ TOp GetOperation<TOp>() where TOp : class, IDomainOperation;
void MarkAsDeleted<TRoot>(TRoot aggregate) where TRoot : class, IAggregateRoot;
@@ -15,11 +15,13 @@ namespace Kostassoid.Anodyne.DataAccess.Operations
{
using System;
- public abstract class BaseDataOperation
+ using Kostassoid.Anodyne.Domain;
+
+ public abstract class BaseDomainOperation : IDomainOperation
{
protected UnitOfWork Owner { get; private set; }
- protected BaseDataOperation()
+ protected BaseDomainOperation()
{
if (UnitOfWork.Current.IsNone)
{
@@ -13,8 +13,10 @@
namespace Kostassoid.Anodyne.DataAccess.Operations
{
+ using Kostassoid.Anodyne.Domain;
+
public interface IOperationResolver
{
- TOp Get<TOp>() where TOp : IDataOperation;
+ TOp Get<TOp>() where TOp : IDomainOperation;
}
}
@@ -21,6 +21,9 @@ namespace Kostassoid.Anodyne.DataAccess
using Events;
using Domain.Base;
using Exceptions;
+
+ using Kostassoid.Anodyne.Domain;
+
using Operations;
using Policy;
using Wiring;
@@ -187,7 +190,7 @@ public void Dispose()
return Query<TRoot>().All();
}
- public TOp Using<TOp>() where TOp : class, IDataOperation
+ public TOp Using<TOp>() where TOp : class, IDomainOperation
{
AssertIfFinished();
@@ -56,6 +56,9 @@
<Compile Include="Events\IDomainEvent.cs" />
<Compile Include="Events\IMutationEvent.cs" />
<Compile Include="Events\PersistentDomainEvent.cs" />
+ <Compile Include="IDomainCommand.cs" />
+ <Compile Include="IDomainOperation.cs" />
+ <Compile Include="IDomainQuery.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@@ -1,4 +1,4 @@
-// Copyright 2011-2012 Anodyne.
+// Copyright 2011-2012 Anodyne.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
@@ -11,9 +11,10 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
-namespace Kostassoid.Anodyne.DataAccess.Operations
+namespace Kostassoid.Anodyne.Domain
{
- public interface IDataQuery : IDataOperation
+ public interface IDomainCommand : IDomainOperation
{
+
}
}
@@ -1,4 +1,4 @@
-// Copyright 2011-2012 Anodyne.
+// Copyright 2011-2012 Anodyne.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
@@ -11,9 +11,10 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
-namespace Kostassoid.Anodyne.DataAccess.Operations
+namespace Kostassoid.Anodyne.Domain
{
- public interface IDataOperation
+ public interface IDomainOperation
{
+
}
}
@@ -1,4 +1,4 @@
-// Copyright 2011-2012 Anodyne.
+// Copyright 2011-2012 Anodyne.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
@@ -11,9 +11,10 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
-namespace Kostassoid.Anodyne.DataAccess.Operations
+namespace Kostassoid.Anodyne.Domain
{
- public interface IDataCommand : IDataOperation
+ public interface IDomainQuery : IDomainOperation
{
+
}
}
@@ -16,6 +16,8 @@ namespace Kostassoid.Anodyne.Node.DataAccess
using Dependency;
using Anodyne.DataAccess.Operations;
+ using Kostassoid.Anodyne.Domain;
+
public class ContainerOperationResolver : IOperationResolver
{
private readonly IContainer _container;
@@ -25,7 +27,7 @@ public ContainerOperationResolver(IContainer container)
_container = container;
}
- public TOp Get<TOp>() where TOp : IDataOperation
+ public TOp Get<TOp>() where TOp : IDomainOperation
{
return _container.Get<TOp>();
}

0 comments on commit daa8132

Please sign in to comment.