Banking Domain - Loans, Anti Corruption, Enterprise Segment and Specifications
Subject: Banking Domain - Loans, Anti Corruption, Enterprise Segment and Specifications
Newsgroups: gmane.comp.programming.domain-driven-design
Date: 2008-07-31 10:56:25 GMT
Hi Eric et 3D Gurus,
We are attempting J to use Domain Driven Design for our banking application, my module mainly pertains to loans.
I would be extremely grateful if you can clarify the following doubts I had with respect to 3D based on that fantastic book.
General DDD Queries
1) Should creation of object be given to repository, I mean, internally the repository will obviously call factory for a NEW object ,or should we just deal with a factory and use the repository for inserts/updates/deletes? (should a repository call the factory for additions?)
Anti – Corruption and Enterprise Segment
2) My Banking subsystems have various domains, like Term Deposits , Loans, Global Domain etc, Is there any point in using an Enterprise Segment and an Anti Corruption Layer?
Example: My Domain (Loans) also needs Objects like “Branch” which belong to the Global Banking Domain , to validate the branch code, hence I created a bank object in my domain(loans) using a Branch Adapter,
BranchExistsSpecificationFactory -> BranchExistsSpecification.isSatisfiedBy()
BranchExistsSpecificationFactory – uses BranchAdapter to fetch a Branch Entity
Now should the branch adapter directly speak to Global Domain to obtain the Branch Information, I essentially have one services LoanAccountCreationService?
Or Should We accept a Enterprise Segment in our Loan Account Creation Service with contains all the information needed by all my adapters, then creation of adapter actually then does not make sense since the I can create a Branch Entity from the Enterprise Segment.
3) Who decides the Structure of an Enterprise Segment ? My Domain or An Application calling Services of my Domain?
Specifications
4) The same example of Loan Account Opening, I have two kinds of Specifications
- Business Policies Specifications – These should be configurable for different implementations eg Spec A and Spec B in SITE 1 and Spec A only in SITE 2
- System Constraints Specifications – These are Mandatory for all SITES, so that loans processing henceforth has no problems.
Have devised the following
ISpecification implemended by AbstractSpecification
MaturityDateSpecificationFactory creates MaturityDateSpecification using LoanProductRepository(has details of specs) , hence MaturityDateSpecificationFactory refers to a repository to build its specification.
LoanAccount is passed to MaturityDateSpecification.isStisfiedBy(loanAccount) to be validated.
LoanAccountOpeningSpecification Calls MaturityDateSpecificationFactory which inturn creates MaturityDateSpecification.
LoanAccountOpeningSpecificationFactory creates LoanAccountOpeningSpecification which infact loops through all such specifications
My Query here is, is this fine? Or have I erred in something?
Secondly, what is the best way to implement Business Policies Specifications, which may be optional in some sites, since I am anyway using a factory (LoanAccountOpeningSpecificationFactory) to create LoanAccountOpeningSpecification, maybe the factory can read from a property file I call only certain specifications, but how do I depict this in my model to a business analyst?
Thirdly, Should System Constraints Specifications (Mandatory for all SITES) be hardcoded in LoanAccountOpeningSpecification?
5) I have certain validations that need to remain during the lifetime of an Entity object,
Example: my loan balance should never go below the min balance indicated in the loan product.
So how do I implement this Specification in my Loan Account Entity? Should I make a separate MinBalanceSpecification? Should I call that specification in my Loan Account in all its Methods ?
Thanks & Regards
Ashley
Ashley Fernandes
Consultant | Banking Products Division | Goregaon Annex, Mumbai
Direct: +91 22 6718 7421| Mobile: +91 9820842428
i-flex solutions has proposed to change its name to Oracle Financial Services
(read more about the proposed name change at www.iflexsolutions.com)
DISCLAIMER:
This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.
__._,_.___
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
RSS Feed