Some APIs that implement a complex object state management often violate the single responsibility principle and make the usage very difficult. When you do all aspects of the complex state management in one inferface the interface’s methods must be invoked in the chronological correct order. Such APIs are hard to understand and to integrate. What we really want are APIs that guide the client code programmers in such situations. Lets take a look at an API that breaks the single responsibility principle and let us think about the consequences for the client code programmer. If you take a look at the FTPClient API of apache commons you can see that all… Read More »Handling complex object state with design
I'm a software developer since 2002 and founded my company Link Intersystems in 2011. My favorite programming language is Java, but I m also experienced in other languages. I focus on design and architecture of java enterprise applications with spring, hibernate or jee. Software quality and therefore clean code belong to my basic principles. ---- If you want others to take you seriously, than take your craftsmanship seriously - be a professional ---- Visit me on careers 2.0 and follow me on stackoverflow.com
The information provided in this blog is validated against hibernate-core 3.6.7.Final and 3.5.6-Final.
There are a lot of discussions about rich and anemic domain models. Some developers tend to praise the anemic model, because of it’s simplicity while other blame the anemic model for it’s simplicity and they pray for the rich domain model. In this blog I want to show both models, the advantages and disadvantages that come with each model to give you a decision and discussion basis. The anemic model An anemic model is a domain model that doesn’t contain any logic. That is why the model is called anemic. It is just a container for data that can be changed and interpreted by clients. Therefore all logic is placed outside… Read More »Anemic vs. Rich Domain Models
Java Beans and Pojos are often used and misunderstood terms. Some think that a pojo is a java bean and vice versa. In fact it is not. There are differences that matter. The pojo If you want to know what a term really means you have to find the source context in which the term has been created. So for the term pojo it was originally created by Martin Fowler, Rebecca Parsons and Josh MacKenzie at a time when J2EE had it’s hype. At that time J2EE developer were more busy with technology instead of concentrating on the business value. The problem arised because J2EE requires a lot of techology code in your… Read More »The difference between pojos and java beans