Skip to main content

Persistence Factories Architectural Design Pattern

  • Conference paper
  • First Online:
Software Architecture (ECSA 2022)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Allen, D.: Getting Things Done. The Art of Stress-Free Productivity, Penguin, January 2003

    Google Scholar 

  2. Cockburn, A.: Writing Effective Use Cases. Addison-Wesley Longman Publishing Co., Inc. (2000)

    Google Scholar 

  3. Evans, E.: Domain-Driven Design. Addison-Wesley (2004)

    Google Scholar 

  4. Fowler, M.: GUI Architectures, July 2006. https://martinfowler.com/eaaDev/uiArchs.html

  5. Fowler, M., Rice, D., Foemmel, M., Hieatt, E., Mee, R., Stafford, R.: Patterns of Enterprise Application Architecture. Addison-Wesley Professional (2002)

    Google Scholar 

  6. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc. (1995)

    Google Scholar 

  7. Jacobson, I.: OO Software Engineering: A Use Case Driven Approach. Addison-Wesley (1992)

    Google Scholar 

  8. Martin, R.C.: OO design quality metrics. In: Proceedings of Workshop on Pragmatic and Theoretical Directions in Object-Oriented Software Metrics (1994)

    Google Scholar 

  9. Martin, R.C.: Clean Architecture: A Craftsman’s Guide to Software Structure and Design, 1st edn. Prentice Hall Press (2017)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jorge D. Ortiz Fuentes .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics