Skip to content
This repository
Browse code

Refactored Data Operations to Domain Operation.

  • Loading branch information...
commit daa8132fb271b4e3fb640588d0ed74c3f7972acf 1 parent f5c243c
Konstantin Alexandroff authored May 29, 2012
5  src/main/Anodyne-DataAccess/Anodyne-DataAccess.csproj
@@ -46,21 +46,18 @@
46 46
     <Compile Include="AggregateRootChangeSet.cs" />
47 47
     <Compile Include="IDataAccessProvider.cs" />
48 48
     <Compile Include="IUnitOfWorkEx.cs" />
49  
-    <Compile Include="Operations\BaseDataOperation.cs" />
  49
+    <Compile Include="Operations\BaseDomainOperation.cs" />
50 50
     <Compile Include="DataSession.cs" />
51 51
     <Compile Include="Exceptions\StaleDataException.cs" />
52 52
     <Compile Include="Exceptions\ConcurrencyException.cs" />
53 53
     <Compile Include="DataChangeSet.cs" />
54 54
     <Compile Include="Events\UnitOfWorkCompletedEvent.cs" />
55  
-    <Compile Include="Operations\IDataCommand.cs" />
56  
-    <Compile Include="Operations\IDataOperation.cs" />
57 55
     <Compile Include="Exceptions\AggregateRootNotFoundException.cs" />
58 56
     <Compile Include="Events\UnitOfWorkRollbackEvent.cs" />
59 57
     <Compile Include="IDataSession.cs" />
60 58
     <Compile Include="IDataSessionEx.cs" />
61 59
     <Compile Include="IDataSessionFactory.cs" />
62 60
     <Compile Include="Operations\IOperationResolver.cs" />
63  
-    <Compile Include="Operations\IDataQuery.cs" />
64 61
     <Compile Include="Operations\IRepository.cs" />
65 62
     <Compile Include="Policy\DataAccessPolicy.cs" />
66 63
     <Compile Include="Policy\StaleDataPolicy.cs" />
5  src/main/Anodyne-DataAccess/DataSession.cs
@@ -15,6 +15,9 @@ namespace Kostassoid.Anodyne.DataAccess
15 15
 {
16 16
     using Domain.Base;
17 17
     using Domain.Events;
  18
+
  19
+    using Kostassoid.Anodyne.Domain;
  20
+
18 21
     using Operations;
19 22
     using System;
20 23
     using System.Collections.Generic;
@@ -50,7 +53,7 @@ public void Handle(IAggregateEvent @event)
50 53
 
51 54
         public abstract IRepository<TRoot> GetRepository<TRoot>() where TRoot : class, IAggregateRoot;
52 55
 
53  
-        public TOp GetOperation<TOp>() where TOp : class, IDataOperation
  56
+        public TOp GetOperation<TOp>() where TOp : class, IDomainOperation
54 57
         {
55 58
             var operation = OperationResolver.Get<TOp>();
56 59
 
5  src/main/Anodyne-DataAccess/IDataSession.cs
@@ -16,6 +16,9 @@ namespace Kostassoid.Anodyne.DataAccess
16 16
 {
17 17
     using Domain.Base;
18 18
     using Domain.Events;
  19
+
  20
+    using Kostassoid.Anodyne.Domain;
  21
+
19 22
     using Operations;
20 23
     using Policy;
21 24
     using Wiring;
@@ -24,7 +27,7 @@ namespace Kostassoid.Anodyne.DataAccess
24 27
     public interface IDataSession : IDisposable, IHandlerOf<IAggregateEvent>
25 28
     {
26 29
         IRepository<TRoot> GetRepository<TRoot>() where TRoot : class, IAggregateRoot;
27  
-        TOp GetOperation<TOp>() where TOp : class, IDataOperation;
  30
+        TOp GetOperation<TOp>() where TOp : class, IDomainOperation;
28 31
 
29 32
         void MarkAsDeleted<TRoot>(TRoot aggregate) where TRoot : class, IAggregateRoot;
30 33
 
6  ...nodyne-DataAccess/Operations/BaseDataOperation.cs → ...dyne-DataAccess/Operations/BaseDomainOperation.cs
@@ -15,11 +15,13 @@ namespace Kostassoid.Anodyne.DataAccess.Operations
15 15
 {
16 16
     using System;
17 17
 
18  
-    public abstract class BaseDataOperation
  18
+    using Kostassoid.Anodyne.Domain;
  19
+
  20
+    public abstract class BaseDomainOperation : IDomainOperation
19 21
     {
20 22
         protected UnitOfWork Owner { get; private set; }
21 23
 
22  
-        protected BaseDataOperation()
  24
+        protected BaseDomainOperation()
23 25
         {
24 26
             if (UnitOfWork.Current.IsNone)
25 27
             {
4  src/main/Anodyne-DataAccess/Operations/IOperationResolver.cs
@@ -13,8 +13,10 @@
13 13
 
14 14
 namespace Kostassoid.Anodyne.DataAccess.Operations
15 15
 {
  16
+    using Kostassoid.Anodyne.Domain;
  17
+
16 18
     public interface IOperationResolver
17 19
     {
18  
-        TOp Get<TOp>() where TOp : IDataOperation;
  20
+        TOp Get<TOp>() where TOp : IDomainOperation;
19 21
     }
20 22
 }
5  src/main/Anodyne-DataAccess/UnitOfWork.cs
@@ -21,6 +21,9 @@ namespace Kostassoid.Anodyne.DataAccess
21 21
     using Events;
22 22
     using Domain.Base;
23 23
     using Exceptions;
  24
+
  25
+    using Kostassoid.Anodyne.Domain;
  26
+
24 27
     using Operations;
25 28
     using Policy;
26 29
     using Wiring;
@@ -187,7 +190,7 @@ public void Dispose()
187 190
             return Query<TRoot>().All();
188 191
         }
189 192
 
190  
-        public TOp Using<TOp>() where TOp : class, IDataOperation
  193
+        public TOp Using<TOp>() where TOp : class, IDomainOperation
191 194
         {
192 195
             AssertIfFinished();
193 196
 
3  src/main/Anodyne-Domain/Anodyne-Domain.csproj
@@ -56,6 +56,9 @@
56 56
     <Compile Include="Events\IDomainEvent.cs" />
57 57
     <Compile Include="Events\IMutationEvent.cs" />
58 58
     <Compile Include="Events\PersistentDomainEvent.cs" />
  59
+    <Compile Include="IDomainCommand.cs" />
  60
+    <Compile Include="IDomainOperation.cs" />
  61
+    <Compile Include="IDomainQuery.cs" />
59 62
     <Compile Include="Properties\AssemblyInfo.cs" />
60 63
   </ItemGroup>
61 64
   <ItemGroup>
7  src/main/Anodyne-DataAccess/Operations/IDataQuery.cs → src/main/Anodyne-Domain/IDomainCommand.cs
... ...
@@ -1,4 +1,4 @@
1  
-// Copyright 2011-2012 Anodyne.
  1
+// Copyright 2011-2012 Anodyne.
2 2
 //   
3 3
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 
4 4
 // this file except in compliance with the License. You may obtain a copy of the 
@@ -11,9 +11,10 @@
11 11
 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 
12 12
 // specific language governing permissions and limitations under the License.
13 13
 
14  
-namespace Kostassoid.Anodyne.DataAccess.Operations
  14
+namespace Kostassoid.Anodyne.Domain
15 15
 {
16  
-    public interface IDataQuery : IDataOperation
  16
+    public interface IDomainCommand : IDomainOperation
17 17
     {
  18
+         
18 19
     }
19 20
 }
7  ...n/Anodyne-DataAccess/Operations/IDataOperation.cs → src/main/Anodyne-Domain/IDomainOperation.cs
... ...
@@ -1,4 +1,4 @@
1  
-// Copyright 2011-2012 Anodyne.
  1
+// Copyright 2011-2012 Anodyne.
2 2
 //   
3 3
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 
4 4
 // this file except in compliance with the License. You may obtain a copy of the 
@@ -11,9 +11,10 @@
11 11
 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 
12 12
 // specific language governing permissions and limitations under the License.
13 13
 
14  
-namespace Kostassoid.Anodyne.DataAccess.Operations
  14
+namespace Kostassoid.Anodyne.Domain
15 15
 {
16  
-    public interface IDataOperation
  16
+    public interface IDomainOperation
17 17
     {
  18
+         
18 19
     }
19 20
 }
7  ...ain/Anodyne-DataAccess/Operations/IDataCommand.cs → src/main/Anodyne-Domain/IDomainQuery.cs
... ...
@@ -1,4 +1,4 @@
1  
-// Copyright 2011-2012 Anodyne.
  1
+// Copyright 2011-2012 Anodyne.
2 2
 //   
3 3
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 
4 4
 // this file except in compliance with the License. You may obtain a copy of the 
@@ -11,9 +11,10 @@
11 11
 // CONDITIONS OF ANY KIND, either express or implied. See the License for the 
12 12
 // specific language governing permissions and limitations under the License.
13 13
 
14  
-namespace Kostassoid.Anodyne.DataAccess.Operations
  14
+namespace Kostassoid.Anodyne.Domain
15 15
 {
16  
-    public interface IDataCommand : IDataOperation
  16
+    public interface IDomainQuery : IDomainOperation
17 17
     {
  18
+         
18 19
     }
19 20
 }
4  src/main/Anodyne-Node/DataAccess/ContainerOperationResolver.cs
@@ -16,6 +16,8 @@ namespace Kostassoid.Anodyne.Node.DataAccess
16 16
     using Dependency;
17 17
     using Anodyne.DataAccess.Operations;
18 18
 
  19
+    using Kostassoid.Anodyne.Domain;
  20
+
19 21
     public class ContainerOperationResolver : IOperationResolver
20 22
     {
21 23
         private readonly IContainer _container;
@@ -25,7 +27,7 @@ public ContainerOperationResolver(IContainer container)
25 27
             _container = container;
26 28
         }
27 29
 
28  
-        public TOp Get<TOp>() where TOp : IDataOperation
  30
+        public TOp Get<TOp>() where TOp : IDomainOperation
29 31
         {
30 32
             return _container.Get<TOp>();
31 33
         }

0 notes on commit daa8132

Please sign in to comment.
Something went wrong with that request. Please try again.