Is cache just a matter of persistence layer ？ If there is no persistence layer in our architecture, only the model layer , Or the persistence layer is relegated to an internal implementation mechanism of the model layer .
It's like we're typing in a computer , We're dealing with... In the editor “ word ”, And these “ word ” It's actually in memory “ word ”, We press “ preservation ” The key is to put the memory “ word ” Persistent to hard disk , If the software can do this automatically , Then we don't have to do , actually , A lot now NoSQL The products are all in memory databases , It contains the internal implementation mechanism of automatic persistence .
If our architecture is based on Model Driven Development , That is to say DDD Design oriented , Instead of focusing on relational database operations , that , The model can only exist in memory , And the operation of the model should obviously be the business layer framework must do .(JdonFramework I've recognized this problem since the first version , Join in Cache Support )
therefore , In a MDD/DDD Architecture , The model layer is the core , There are entities in the model Value objects and services . These must be supported by the business layer framework , What's better now is DCI Framework to support .
Let's go back and see Spring 3.1 Of cache What support is like ？ It imports the general caching mechanism , You can cache any Java class Method or library package , It can also be used with existing caching mechanisms, such as ehcache or hazelcast Support , To improve performance .
From its release notes ,Cache At present, it is only used to improve performance , It's not up to the level of support for domain models .Spring Let's wait for you to lead the public to model driven development ？ Or MDD/DDD It's really advanced , Too aggressive ？ Or is your pace too backward ？
[ The quilt banq On 2011-02-24 10:50 A modified ]