I have searched the web for this issue. And there is a post already with the same title, but not really describing the actual question. So I haven't found the right solution.
I'm developing very large projects. So it is absolutely necessary to split it up into several layers or components or whatever you want to call it.
Each layer exposes some functionality. For each layer it is not important how it will be implemented (since this changes oftenly on large projects), but what is important, is how we call the functionality and what it returns us => the contract!
If we have two layers one concerning the TransactionService and another the BankService, the BankService is a layer higher than the TransactionService and will use the transactionservice. The transactionService will merely do a transaction:
TransactionVO doTransaction(clientFromVO, clientToVO);
And another layer which does additional stuff.. TransactionVO is not an model class! They are value-objects so the implementation of the service is not exposed to outside the layer. In java we can achieve this by:
public interface TransactionService {
TransactionVO doTransaction(clientFromVO, clientToVO);
}
The implementation would be like:
public class TransactionServiceImpl {
public TransactionVO doTransaction(clientFromVO, clientToVO) {
// implementation
}
}
Because we define our interfaces up front, we have a contract which states how each service will look like (without having an actual implementation, the TransactionServiceImpl doesn't need to exist yet).
Therefor 2 teams can work simultaneously on each layer and they can mock the implementation. I wonder how to achieve this in Django! Creating a REST api for each layer is simpily not done (to much overhead, performance issues..) So for those who have experience on very large projects?