Abstract
Each screen of the user interface of a mobile or desktop application coordinates one or more use cases. Each one of those use cases may need to access different entities of the persistent data. It is a common practice to inject a provider for each of those entities of the model. Thus, the more use cases the view deals with, the more entity providers need to be injected. If we extend that to all the views of the application, the complexity increases and the impact in maintainability of the application is huge.
In this paper we present an architectural design pattern to address this problem, as well as an analysis of its merits. The main idea behind the architectural pattern is that use cases take care of requesting the required entity providers from a unique element that is the persistence factory. Therefore use cases are created with the required entity provider(s) injected, allowing the other components of the architecture to be completely decoupled from the implementation of the persistence and simplifying the dependency injection process. The included code snippets compare our solution with most used industrial alternatives.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Allen, D.: Getting Things Done. The Art of Stress-Free Productivity, Penguin, January 2003
Cockburn, A.: Writing Effective Use Cases. Addison-Wesley Longman Publishing Co., Inc. (2000)
Evans, E.: Domain-Driven Design. Addison-Wesley (2004)
Fowler, M.: GUI Architectures, July 2006. https://martinfowler.com/eaaDev/uiArchs.html
Fowler, M., Rice, D., Foemmel, M., Hieatt, E., Mee, R., Stafford, R.: Patterns of Enterprise Application Architecture. Addison-Wesley Professional (2002)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc. (1995)
Jacobson, I.: OO Software Engineering: A Use Case Driven Approach. Addison-Wesley (1992)
Martin, R.C.: OO design quality metrics. In: Proceedings of Workshop on Pragmatic and Theoretical Directions in Object-Oriented Software Metrics (1994)
Martin, R.C.: Clean Architecture: A Craftsman’s Guide to Software Structure and Design, 1st edn. Prentice Hall Press (2017)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Ortiz Fuentes, J.D., Herranz Nieva, Á. (2022). Persistence Factories Architectural Design Pattern. In: Gerostathopoulos, I., Lewis, G., Batista, T., Bureš, T. (eds) Software Architecture. ECSA 2022. Lecture Notes in Computer Science, vol 13444. Springer, Cham. https://doi.org/10.1007/978-3-031-16697-6_12
Download citation
DOI: https://doi.org/10.1007/978-3-031-16697-6_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-16696-9
Online ISBN: 978-3-031-16697-6
eBook Packages: Computer ScienceComputer Science (R0)