History of objects in a repository?
tdobe
Posts: 5 Bronze 2
Hi,
When you are in revision history, can you search for all changes to one object (e.g. table). Such option is available in TortoiseSVN, clicking on an object shows all revisions containing modification of that object.
Thx
When you are in revision history, can you search for all changes to one object (e.g. table). Such option is available in TortoiseSVN, clicking on an object shows all revisions containing modification of that object.
Thx
Answers
If you're still experiencing this issue would you be able to reach out to us in support and we can investigate this further https://productsupport.red-gate.com/hc/en-us
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
We have an aggregate root called
Animal
, which has properties such asStatus
andSource
. Currently the database has two tables calledStatusHistory
andSourceHistory
, which stores information about the animal when the status is changed. These tables sometimes have records deleted, and rarely need to be retrieved when getting anAnimal
from theAnimalRepository
.So the big question is where do they belong? Here are a couple of ideas we have:
Have them both as different entity objects as part of the animal aggregate. And have corresponding methods which allow them to be updated eg:
Animal.UpdateStatus(newStatus)
, which would add to the collection with anew StatusHistory(this)
object. But as mentioned above these are rarely required when get an existing animal for the repository, so we don't wan't the repository loading them. We are currently not using an ORM and are manually mapping using a table data gateway inside the repositories.Make each of the history entities an aggregate root. We are not a fan of this , as it feel like we aren't really modelling the domain and just drifting towards an
Active Record Pattern
. Also the task of updating these for the animal with have to lie outside of the animal entity.We could try combining these histories into another aggregate root called
AnimalHistory
whose whole purpose is to maintain the history of the animal. But again it would be moving logic about storing the history into something other then the animal. Possibly a service likeAnimalProcessingService
, which feel like we might be heading toward an anemic design.