|
Java Persistence with Hibernate
with Gavin King November 2006 Manning Publications 841 pages (English), PDF ebook 703 pages (German) |
|
Hibernate in Action
with Gavin King August 2004 Manning Publications 408 pages (English), PDF ebook |
|
Unternehmen im Internet
with Ingo Petzke, Michael Mueller 1998 Oldenbourg 300 pages (German) |
10. Apr 2012, 13:38 CET, by Christian Bauer
A few years back I wrote the integration code for the now defunct Seam framework and RestEasy, a JAX-RS
implementation. For a new prototype I've been looking at Wink as a
JAX-RS provider, not least because it has WebDAV/APP/Atom/RSS support. I also want to manage
more... |
20. Oct 2011, 10:44 CET, by Christian Bauer
Some notes on how to create an HTML interface that works with all kinds of screen sizes popular today,
no matter if it's workstation or portable. This solution relies on pure HTML/CSS, so IE6/7/whatever are
out.
The layout has to be elastic, this is essential.
more... |
18. Oct 2011, 14:19 CET, by Christian Bauer
Regular visitors might notice some changes to the website and projects. The big news is that
we are now incorporated as 4th Line GmbH in
Switzerland. We are a team of software and IT systems experts offering a range of services,
with a focus on Free Software. If you need help
more... |
Archive starts here...
This is a reply on the Hibernate forum, read the full thread for the context.
As some noticed, I'm a bit impulsive about that kind of thing right now. We get one question a day, sometimes friendly, sometimes not so friendly, if we could just set up the book (Hibernate in Action) for free download or simply send it over.
Don't take it personal if I'm getting annoyed about that. It's sometimes just embarrassing when someone gives you the feeling that you owe them something, just because they use Hibernate. I'd like to explain why its not about the money for the book.
First, and that is really my own personal opinion, a professional Java developer should have enough money for whatever book in any case. Books are important, read at least one each month, better two. I don't buy any of that offshore jobs talk, but knowledge is the only thing that keeps you in business. I don't want to discuss $5 Amazon shipping costs about that.
Now I'd like to start a little rant here, so you better stop reading if you are not in the mood :)
Our software is free, our documentation is of course free, and we will always provide free support on a personal level in this forum, and whenever we think it is needed.
I also think that our software and the whole project shows that we are serious about what we are doing. We worked many nights and weekends last year. Gavin and me quit our jobs to make this possible. Max, David, Steve, Emmanuel spend hours a day after work, writing interesting things and answering questions (now up to 120/day) on the forum.
We really believe in professional open source as a business model in the software sector. Actually I'm now also employed by JBoss Group. We have two people working fulltime on Hibernate.
How do we earn our salary?
With open source, there are no license fees. This is great for developers, as they can sell the software they'd like to use to their project managers and accountants easily. Well, of course only if all the other qualities are right:
- good software
- good documentation and free support
- commercial support (risk management)
- nice extras
A successful vendor of closed software can provide the second for free, but you have to pay for the other three
most of the time. Sometimes its hidden, sometimes not. The situation is quite different with an open source
software project. First, there are no hidden costs, because you actually can't hide anything. Second, we as software
developers don't like hiding any costs somewhere, we are not good with that kind of thing. It's much easier to tell
people what they need and what it costs upfront. I also like the look on peoples faces if you admit
that
Hibernate solves only 95% of their problems, not 100! Shocking! The truth!
It's hard to break with the traditions and I remember the early Linux days when it was first used used commercially. You actually had to tell people that free software is good because they don't pay money for licenses. They wouldn't believe you, just don't ask for a (real) reason. Usually they expected some hidden costs in the other three items and simply denied that it was any good at all.
Sometimes, I think it was too much propaganda back then, now everyone expects everything for free!
To support a business, some revenue must be made from at least one of the four elements I listed.
I'm not talking about the book, because that really doesn't pay. I think most people know that books don't pay in the end, at least if your name is not Fowler or Bloch. Why do we write it then? It helps us to get more people (and therefore ideas and opinions) into Hibernate, and we can finally write down some thoughts we can't express in any other medium.
And yes, we also hope that it will help us to grow the Hibernate business. Thats our job. There is no professional quality without that background, or at least not for a long period of time.
Hibernate is naturally a very open project driven by the users. This will not change, no matter what our business model is. We think that listening to users and balancing requests is the heart of the project, it is the reason why people like it and why it works(tm).
About two years ago, a co-worker asked me innocently: What are scalar types anyway?
I realized that I had used that term one too often and he was really asking if I can define it, not just use it.
On my way to the JavaPolis conference I had some time to write up what I understand about /scalar types/. The truth is, I had a lot of time, because my train got the wrong route (twice!), and we even had to go backwards several times.
Just to make this entry even more exciting, I'll also explain what I understand as a /variable/ and a /value/.
A type names a /set of values/. So, a type has a name, we know that. But what is
this set of values
? According to Chris Date, a value is an /individual constant/.
Now, stop thinking in software terms, and think about information and data. A
value has, by definition, no location in time and space. For example, we don't know
where or when the value Hibernate is located, this question doesn't even make
sense. It's a value nevertheless, just as the number 4 and the number 2.
We know that in a strongly typed language such as Java, every value has to have a type. This means that every value in our software carries its type with it. Instead of working with value literals, as I did in the previous paragraph, we assign them to variables. A variable gives a value a location in time and space. In Java, the type of a value is associated with the variable.
String projectName; projectName = "Hibernate"
In the first line, we declare that String is the type of the variable projectName. The values that can be assigned to projectName are therefore limited to the set of values allowed for the String type, i.e., all character strings. In the next line, we assign the value Hibernate to the variable projectName. The assignment operator (=) checks both operands for compatibility: Is the given value in the set of values allowed for the variables type? Strong typing means that this check is performed for all operations, including all method (operator) calls, not only assignment.
Let's talk about types in Java. We have built-in types such as String, but also custom
user-defined types, such as Project. But a Java /class/ is only the mechanism used for
type declaration and implementation. Sometimes we are sloppy and say a class is
a type
, but strictly speaking, it is not. A type is all externally visible elements of
a class, that is all operators (methods) and components (attributes) declared public. We
just use the mechanism of a class to define this, and of course, to implement the actual
(internal) representation. So the following class defines and implements the Project
type:
public Project {
public String projectName;
public void makeOpenSource() {
...
}
public Team getProjectTeam() {
...
}
}
The Project type has one component and two operators. But where is this set of values
defined?
Consider the type Object in Java: This type implies a set with all possible values. So, in fact,
the set is implicit if you create a type. In other words, if you declare a variable of type
Object, you can assign whatever value you want. By creating a type (writing a class or interface),
you narrow that set. For example, a type Project might imply a set of all possible projects. You
can of course further restrict the allowed values by adding constraints to that type (only projects
with a name shorter than 10 characters
), but thats not the issue here.
Back to the initial question: A scalar type is a type that is /encapsulated/, that is, it doesn't have any user-visible components. The Project type in the example above is non-scalar, it has the user-visible component (attribute) projectName.
On the other hand, the Team returned by the select operator getProjectTeam does not reveal a component, but only gives us a part of the possible representation of a Project. We simply don't now (and shouldn't care) if the Team returned is internally a component (attribute) of the Project or something completely different. The implementation is hidden.
If we follow the Best Practices for POJOs (or JavaBeans), we automatically create scalar types. Adding a select operator such as getProjectName and removing the public visible component projectName would make the example Project type scalar, that is encapsulated or atomic.
Keep in mind that /scalar/ is not related to /complexity/ in any way. Just because we call
Java primitives scalar
, doesn't make all scalar types primitive.
|
|
|
Showing 46 to 47 of 47 blog entries |