Design Patterns and Electric Vehicle Charging Software
1.1. Design Patterns in Software Development
1.2. State of the Art
2. Incursion in the Design Patterns Field
2.1. Design Patterns—Benefits and Potential Drawbacks
2.2. Distinction between Design Patterns and Design Principles
- Single-responsibility principle: a class should be appointed only one job to handle, one single reason to change.
- Open-closed principle: object or entities are closed for modifications but opened for extensions.
- Liskov substitution principle: “Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.” . This statement implies that all subclasses should be interchangeable with their parent class.
- Interface segregation principle: this principle requires that the software programs should be independent from the interfaces that they do not use.
- KISS (keep it simple stupid): the principle states that the majority of systems work at their best when kept simple, rather than intricate.
2.3. Software Design Patterns Classification
- Creational design patterns deal with the mechanisms of object creation. Their purpose is “to separate a system from how its objects are created, composed and represented. They increase the system’s flexibility in terms of the what, who, how and when of object creation” .
- Structural patterns deal with identifying simple ways of establishing relationships among objects.
- Behavioral patterns identify and realize common communication patterns between objects.
3. Design Patterns and EV Charging Software
- Software design patterns, which constitute the optimal solutions employed by skilled object-oriented developers to general issues that software developers face during development process.
- Cloud design patterns that have proven valuable for constructing scalable, dependable and secure applications in the cloud.
- Multitenancy model, which assures a stable, isolated, low cost, customizable and scalable cloud architecture for the application’s multiple tenants.
3.1. Software Design Patterns
3.1.1. Singleton Pattern
3.1.2. Dependency Injection Design Pattern
3.1.3. Façade Pattern
3.1.4. Repository Pattern
3.1.5. Template Method Pattern
3.2. Cloud Design Patterns
3.2.1. Publisher/Subscriber Pattern
- Publishers are loosely coupled to subscribers and can remain oblivious to their existence. Publishers and a subscriber can even be temporarily decoupled.
- Provides scalability and improves responsiveness of the sender.
- Improves reliability.
- It ensures a cleaner integration between systems that employ different platforms, programming languages and communication protocols.
3.2.2. Sharding Pattern
3.2.3. Static Content Hosting pattern
- Minimize hosting costs for static resources; contingent upon the capabilities of the hosting/cloud provider, entire static websites can be hosted.
- Minimize bandwidth usage. Low bandwidth usage can be achieved using content delivery network, by presenting the cached content from multiple geographical areas datacenter around the world.
3.2.4. Retry Pattern
- The application calls upon an operation on hosted service and the internal server error is returned (code 500).
- The application then waits for a short while, before trying again. The failure message is returned once more (code 500).
- Then, the waiting time increases, before trying once again. The HTTP response is now code 200 (OK) and the request is successful.
- Non-critical operations are preferred to fail faster rather than repeating the request several times and affecting the input of the application.
- Aggressive retry policy should have large delays and small number of retries.
- If a request has several failures, maybe it is best to prevent further requests
- Some of the retries may be idempotent (retry logic should handle errors from incomplete requests)
- All retry codes should be fully tested against a wide range of failures conditions.
- All failures should be logged, so that underlying problems can be identified.
3.3. Multitenant Database Design Patterns
- Multitenant app with multitenant databases;
- Multitenant app with database-per-tenant;
- Multitenant app with sharded multitenant databases.
- Tenant isolation;
- Cost per tenant;
- Development complexity;
- Operation complexity;
3.3.1. Multi-Tenant App with Sharded Multitenant Databases
3.3.2. Shards Management
3.3.3. Shards Management Tools
- Managing shards and shard maps;
- Data-dependent routing;
- Querying over multiple shards;
- Adding empty shards;
- Splitting existing shards;
- Merging existing shards.
3.3.5. Data-Dependent Routing
3.3.6. Row Level Security
4. Results and Discussion
5. Future Research Directions
Conflicts of Interest
- Amato, F.; Moscato, F. Model transformations of MapReduce Design Patterns for automatic development and verification. J. Parallel Distrib. Comput. 2017, 110, 52–59. [Google Scholar] [CrossRef][Green Version]
- Cacho, N.; Sant’anna, C.; Figueiredo, E.; Dantas, F.; Garcia, A.; Batista, T. Blending design patterns with aspects: A quantitative study. J. Syst. Softw. 2014, 98, 117–139. [Google Scholar] [CrossRef]
- Fojtik, R. Design patterns in the teaching of programming. J. Procedia Soc. Behav. Sci. 2014, 143, 352–357. [Google Scholar] [CrossRef]
- Van Diggelen, W.; Overdijk, M. Grounded design: Design patterns as the link between theory and practice. Comput. Hum. Behav. 2009, 25, 1056–1066. [Google Scholar] [CrossRef]
- Hussain, S.; Keung, J.; Khan, A.A. Software design patterns classification and selection using text categorization approach. Appl. Soft Comput. 2017, 58, 225–244. [Google Scholar] [CrossRef]
- Arcelli, D.; Di Pompeo, D. Applying Design Patterns to Remove Software Performance Antipatterns: A Preliminary Approach. Procedia Comput. Sci. 2017, 109, 521–528. [Google Scholar] [CrossRef]
- ElSayed, N.A.; Smith, R.T.; Marriott, K.; Thomas, B.H. Context-aware design pattern for situated analytics: Blended Model View Controller. J. Vis. Lang. Comput. 2018, 44, 1–12. [Google Scholar] [CrossRef]
- Lezama, O.B.; Manotas, E.N.; Mercado-Caruzo, N. Analysis of design patterns for educational application development: Serious Games. Procedia Comput. Sci. 2020, 175, 641–646. [Google Scholar] [CrossRef]
- Casteigts, A.; Métivier, Y.; Robson, J.M.; Zemmari, A. Design patterns in beeping algorithms: Examples, emulation, and analysis. Inf. Comput. 2019, 264, 32–51. [Google Scholar] [CrossRef][Green Version]
- Lano, K.; Kolahdouz-Rahimi, S.; Yassipour-Tehrani, S.; Sharbaf, M. A survey of model transformation design patterns in practice. J. Syst. Softw. 2018, 140, 48–73. [Google Scholar] [CrossRef][Green Version]
- Fogli, D.; Greppi, C.; Guida, G. Design patterns for emergency management: An exercise in reflective practice. Inf. Manag. 2017, 54, 971–986. [Google Scholar] [CrossRef]
- Kim, D.-K.; Lu, L.; Lee, B. Design pattern-based model transformation supported by QVT. J. Syst. Softw. 2017, 125, 289–308. [Google Scholar] [CrossRef]
- Ergin, H.; Syriani, E.; Gray, J. Design pattern oriented development of model transformations. Comput. Lang. Syst. Struct. 2016, 46, 106–139. [Google Scholar] [CrossRef]
- Šljivo, I.; Uriagereka, G.J.; Puri, S.; Gallina, B. Guiding assurance of architectural design patterns for critical applications. J. Syst. Archit. 2020, 110, 101765. [Google Scholar] [CrossRef]
- Mayvan, B.B.; Rasoolzadegan, A.; Yazdi, Z.G. The state of the art on design patterns: A systematic mapping of the literature. J. Syst. Softw. 2017, 125, 93–118. [Google Scholar] [CrossRef]
- Ampatzoglou, A.; Michou, O.; Stamelos, I. Building and mining a repository of design pattern instances: Practical and research benefits. Entertain. Comput. 2013, 4, 131–142. [Google Scholar] [CrossRef]
- Moudam, Z.; Chenfour, N. Design Pattern Support System: Help Making Decision in the Choice of Appropriate Pattern. Procedia Technol. 2012, 4, 355–359. [Google Scholar] [CrossRef][Green Version]
- Tounsi, I.; Kacem, M.H.; Kacem, A.H.; Drira, K. Transformation of compound SOA Design Patterns. Procedia Comput. Sci. 2017, 109, 408–415. [Google Scholar] [CrossRef]
- Arm, J.; Bradac, Z.; Bastan, O.; Streit, J.; Misik, S. Design pattern for the runtime model-based checking of a real-time embedded system. Ifac Pap. 2019, 52, 127–132. [Google Scholar] [CrossRef]
- Villareal-Freire, A.P.; Aguirre, A.F.A.; Ordoñez, C.A.C. Reverse engineering for the design patterns extraction of android mobile applications for attention deficit disorder. Comput. Stand. Interfaces 2019, 61, 147–153. [Google Scholar] [CrossRef]
- Li, J.; Daaboul, J.; Tong, S.; Bosch-Mauchand, M.; Eynard, B. A design pattern for industrial robot: User-customized configuration engineering. Robot. Comput. Integr. Manuf. 2015, 31, 30–39. [Google Scholar] [CrossRef]
- Aljasser, K. Implementing design patterns as parametric aspects using ParaAJ: The case of the singleton, observer, and decorator design patterns. Comput. Lang. Syst. Struct. 2016, 45, 1–15. [Google Scholar] [CrossRef][Green Version]
- Bai, J.; Luo, H.; Qin, F. Design pattern modeling and extraction for CAD models. Adv. Eng. Softw. 2016, 93, 30–43. [Google Scholar] [CrossRef]
- Hasheminejad, S.M.H.; Jalili, S. Design patterns selection: An automatic two-phase method. J. Syst. Softw. 2012, 85, 408–424. [Google Scholar] [CrossRef]
- Pauwels, S.L.; Hübscher, C.; Bargas-Avila, J.A.; Opwis, K. Building an interaction design pattern language: A case study. Comput. Hum. Behav. 2010, 26, 452–463. [Google Scholar] [CrossRef]
- Mayvan, B.B.; Rasoolzadegan, A. Design pattern detection based on the graph theory. Knowl. Based Syst. 2017, 120, 211–225. [Google Scholar] [CrossRef]
- Lee, J.H.; Chakraborty, D.; Hardman, S.J.; Tal, G. Exploring electric vehicle charging patterns: Mixed usage of charging infrastructure. Transp. Res. Part D Transp. Environ. 2020, 79, 102249. [Google Scholar] [CrossRef]
- He, Y.; Zhang, Q.; Pang, Y. The development pattern design of Chinese electric vehicles based on the analysis of the critical price of the life cycle cost. Energy Policy 2017, 109, 382–388. [Google Scholar] [CrossRef]
- Guo, H.; Hou, D.; Du, S.; Zhao, L.; Wu, J.; Yan, N. A driving pattern recognition-based energy management for plug-in hybrid electric bus to counter the noise of stochastic vehicle mass. Energy 2020, 198, 117289. [Google Scholar] [CrossRef]
- Miller, I.; Arbabzadeh, M.; Gencer, E. Hourly Power grid variation, electric vehicle charging patterns and operating emission, ACS Publication. Environ. Sci. Technol. 2020. [Google Scholar] [CrossRef]
- Hilton, G.; Bryden, T.; de Leon, C.P.; Cruden, A. Dynamic charging algorithm for energy storage devices at high rate EV chargers for integration of solar energy. Energy Procedia 2018, 151, 2–6. [Google Scholar] [CrossRef]
- Rata, M.; Rata, G.; Filote, C.; Raboaca, M.S.; Graur, A.; Afanasov, C.; Felseghi, A.R. The Electrical Vehicle Simulator for Charging Station in Mode 3 of IEC 61851-1 Standard. Energies 2020, 13, 176. [Google Scholar] [CrossRef][Green Version]
- Badea, G.; Felseghi, R.-A.; Varlam, M.; Filote, C.; Culcer, M.; Iliescu, M.; Răboacă, M.S. Design and Simulation of Romanian Solar Energy Charging Station for Electric Vehicles. Energies 2019, 12, 74. [Google Scholar] [CrossRef][Green Version]
- Raboaca, M.S.; Filote, C.; Bancescu, I.; Iliescu, M.; Culcer, M.; Carlea, F.; Lavric, A.; Manta, I.; Lungu, F.; Bisoc, A.L. Simulation of a Mobile Charging Station Operational Mode Based on Ramnicu Valcea Area. J. Prog. Cryog. Isot. Sep. 2019, 22, 45–54. [Google Scholar]
- Fodorean, D.; Cirlea, F.; Raboaca, M.S.; Filote, C. New mobile charging station for urban and resort areas. In Proceedings of the 2019 Electric Vehicles International Conference (EV), Bucharest, Romania, 3–4 October 2019; pp. 1–6. [Google Scholar]
- Răboacă, M.S.; Băncescu, I.; Preda, V.; Bizon, N. Optimization Model for the Temporary Locations of Mobile Charging Stations. Mathematics 2020, 8, 453. [Google Scholar] [CrossRef][Green Version]
- Gamma, E.; Helm, R.; Johnson, R.; Vlissides, J.; Patterns, D. Design Patterns—Elements of Reusable Object-Oriented Software; Addison-Wesley: Boston, MA, USA, 1994. [Google Scholar]
- Wikipedia. Available online: https://en.wikipedia.org/wiki/Decorator_pattern (accessed on 21 October 2020).
- Wikipedia. Available online: https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design#dependency-inversion-principle (accessed on 22 October 2020).
- Wikipedia. Available online: https://en.wikipedia.org/wiki/Creational_pattern (accessed on 21 October 2020).
- Available online: https://michael.hahsler.net/research/patterns_oss2004/OSS_patterns_preprint.pdf (accessed on 27 October 2020).
- Available online: https://code-maze.com/net-core-web-development-part4/ (accessed on 3 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/architecture/patterns/publisher-subscriber (accessed on 3 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/architecture/patterns/sharding (accessed on 3 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/architecture/patterns/static-content-hosting (accessed on 3 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/architecture/patterns/retry (accessed on 4 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/azure-sql/database/saas-tenancy-app-design-patterns (accessed on 4 November 2020).
- Available online: https://docs.microsoft.com/en-us/azure/azure-sql/database/saas-tenancy-elastic-tools-multi-tenant-row-level-security (accessed on 4 November 2020).
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Meheden, M.; Musat, A.; Traciu, A.; Viziteu, A.; Onu, A.; Filote, C.; Răboacă, M.S. Design Patterns and Electric Vehicle Charging Software. Appl. Sci. 2021, 11, 140. https://doi.org/10.3390/app11010140
Meheden M, Musat A, Traciu A, Viziteu A, Onu A, Filote C, Răboacă MS. Design Patterns and Electric Vehicle Charging Software. Applied Sciences. 2021; 11(1):140. https://doi.org/10.3390/app11010140Chicago/Turabian Style
Meheden, Maria, Andrei Musat, Andrei Traciu, Andrei Viziteu, Adrian Onu, Constantin Filote, and Maria Simona Răboacă. 2021. "Design Patterns and Electric Vehicle Charging Software" Applied Sciences 11, no. 1: 140. https://doi.org/10.3390/app11010140