I am now entering the world of java ee 6. And I am supposed to used different technologies like jsf, jpa, different kinds of beans and all that stuff.I am learning using the netbeans IDE, which is, I should say, very efficient when it comes to getting the work done.It is just that, I came from the old school servlet programming environment using scriptlets on them jsp pages where you get to write every line and every request parameter/attribute you have to set manually. which is somehow good because you get to understand you program THAT WELL.but with this java ee 6, with the code generators from NETBEANS, I get to create controllers, jsf pages and entities without writing any code (taken aside the DB part though). I do understand the flow of the application but not to the degree that I can understand what the line does, how does it reached, what are the use of the variables and what does it do after. all the nitty gritty stuff.to make it short, I am using generators without REALLY understanding the code that well (mostly on the new tags by jsf). I just want to ask if this is a bad path/practice or is it ok because we want PRODUCTIVITY?
in doubt of using code generators
java;code quality;jpa
The ability to abstract is one of the most powerful tools of the human brain. It allows it to handle complex systems as simple entities, provided the abstractions it works with are suitable.This concept is very often applied to programming, because inevitably, we have to handle complex systems. Even Java as a language is already an abstraction of the JVM, which in turn is an abstraction of the actual machine you are running on. SQL is an abstraction of relational databases, which in turn are an abstraction of storage.All this works well, because you think in terms of concepts in one abstraction layer, and this layer is separated from the layers below through an abstraction barrier. This is very well explained in SICP.Based on this is the rather common approach of abstracting architecture and infrastructure. Libraries that do that are commonly referred to as frameworks (although nowadays everything is referred to as a framework).One thing you will have to accept with frameworks is, that you must think within the abstraction layer they provide. How they work internally is none of your concern (assuming they work as specified) except for personal curiosity.It is important to understand what a software component does, not how. In fact relying on the how is a good way of shooting yourself in the foot. Standing on the shoulders of giants is good.Now to come back to code generators: Code generators are in a way an instrument of abstraction. You say: I want a controller for this and that, and zooooom it's there. You don't have to think about how it ties into the rest of the infrastructure, because all that is abstracted away. This is good.However, I earlier mentioned the concept of abstraction barriers. An inherent problem of code generators is they provide no abstraction barrier. All the stuff they need, they do not hide it from you, but instead they throw it in your face. And you have code that consists of parts that you must change and parts that you mustn't change (as long as you want to stay in the same abstraction layer).In some languages, Java being the canonical example, code generators are inevitable if you want to reach certain levels of abstraction. But as long as you have a clear understanding what the purpose of the code is that you generate and know which parts not to touch, you're on the safe side. 