Context
Currently I'm working in a Documents and Records Management System (DRMS?). Because of some technical limitations I need to store a "view" file and a "source" file (DOCX or XLSX). A view file is a PDF file for users to print, download and view for every day usage while a source file is the editable file. When users require to update a file, they will download the source, update it, and upload a new view file and the corresponding source file.
I'm not able, at this time, to implement XLSX viewers/editors and, due to the quantity of files, I cannot migrate to ODFs in order to use open source viewers available.
Right now I have two models like this:
public class Document {
//Other fields
public virtual List<DigitalFile> Files { get; set; }
}
public class DigitalFile {
//Other fields
public virtual Document FileOf { get; set; }
}
The Document
model has all the "business" data while the DigitalFile
model has data about the files themselves (path, url, type, etc.)
Each time a document is created it will have 1 view file (required) and it may have 1 source file (some documents may not be editable). From this you can know that when a document is created/updated at least 1 digital file will be created/updated as well.
Problem/Question
I will have a DocumentAppService
to handle all the CRUD operations but here's where my doubt comes, should I be calling an AppService from another AppService? I mean, when a Document is created, should the Create method call another Create method in DigitalFileAppService
? Or should it be better if DocumentAppService
handled everything on its own?
Right now all the CRUD operation on DigitalFile are tied to the operations on Document, which is why I'm in doubt of implementing an AppService for the files.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…