Is hibernate considered white box or black box?

Asked

Viewed 138 times

5

From what I understand the frameworks, Black box are known for their ease of use as it is not necessary to understand what is happening inside of it to use, and the white box otherwise, a knowledge of the internal structure of the framework is required for use.

In the case of Hibernate, in which category it is?

2 answers

5


Well, I doubt any framework purely black box exists for two simple reasons. The first is due to law of Leaky abstractions and the second is that to use the framework, you need to know at least something minimal of the classes or methods that exist in it so that you have some public API. So something completely black box is simply not usable.

But the question is how deeply this public (or even non-public) API engages and how much the programmer must venture into it in order for the framework to be used. If a framework’s public API is relatively simple, cohesive, intuitive, provides a low coupling and does not require in-depth knowledge of the framework’s working details, then it is probably the most black that could be. There may even be deeper details of the public API for on-call hackers to be able to do internal tunneling or customization for whatever reason, but we may disregard the case of internal public Apis for specific cases. The problem is when access to internal details or nuances of how the framework works becomes essential to your use.

Anyway, I consider him the Hibernate relatively black box, since it is quite possible to program using the Hibernate through JPA interfaces only (eg: EntityManager) and notes. Obviously, you have to know how to use the public JPA API and know the meaning of the annotations, and sometimes they can be a little complicated. Also, from time to time some sordid detail of relationships @ManyToMany, caches, limitations of fetching of multiple entities related to a single record, or specific properties you will need on persistence.xml appear as Leaky abstractions or as details white box, and sometimes some internal detail of the Hibernate it is necessary to be used or at least understood. Therefore, I would classify it as mostly black box, something like a dark Gray box.

A counterexample would be the case of Swing. There are a lot of methods to do all kinds of things, often in a non-intuitive, redundant way or with very complex interactions with each other. This results in super-heavy classes that accumulate multiple inheritance levels collecting hundreds of methods along the way. In addition, there are several complex details about Event Dispatch Thread, component design management using Java2d, differences between Heavyweight and lightweight components, complex ways to get and focus between elements, and a lot of other things that make using this API a difficult thing to be able to work with it efficiently (and probably one of the main reasons why it never really took off, lagging behind its competitors and reduced to certain niches). Hence, the Swing is mostly white box (something like a Pale Gray box).

3

White box. After all you have access to fonts if you want to test in a totally transparent way. Black box for example are components that you don’t have to access or modify your behavior.

If your question was related to the General Theory of Systems or Tests, this is the correct answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.