samedi 29 avril 2023

How come design patterns followed by JDBC API and JPA are different?

I was trying to understand the design patterns and their implementation within the Java library itslef:

I am bit confused when it comes to these two APIs:

  1. JDBC API: This API is said to implement Bridge design pattern.

Bridge pattern is a structural design pattern in software development that is used to decouple an abstraction from its implementation so that both can be modified independently. And if we stick to specification, we can easily replace one implementation with another.

  1. JPA: This API is said to implement ORM/Factory (EntityManagerFactory) design pattern.

As far as I know, if we stick to JPA specification then we can easily replace one implementation (ex. Hibernate) with another (ex. EclipseLink). Which means API and implementation can be developed independently.

So can someone please tell me why not JPA is also called to implement Bridge design pattern?

Aucun commentaire:

Enregistrer un commentaire