Google Collections

Sune Simonsen

Google Collections is a natural evolution from the standard collections API in Java, bringing a much broader range of functionality to the existing collections and also providing several new collections for its users. The library plays nice with the standard collections and uses existing functionality where possible. Here is a list of useful facts before [...]

Tags: , , , , , , , , , , ,

Creating a TinyMce plugin for a Wicket application

Rickard Nilsson

I’m currently working on a web project based on Wicket. In this web project there was a request for a web based word processor. TinyMce fits the bill perfectly and as it happens is also integrated in Wicket. Lucky me! Another request required me to make my own plugin for TinyMce. Only, it turned out [...]

Tags: , , , , , , ,

Qi4j and the NoSQL movement

Rickard Öberg

The second presentation from JavaZone 2009 that I want to comment on is “På tide å kaste ut relasjonsdataben?” (Is it time to throw out the relational database?) by Trond Arve Wasskog, which continues the current trend of looking at alternatives to relational databases for persistence.

For myself, I have for some time argued that most people seem to be using relational databases for four separate things: storing objects, querying them, reports, and backups. In my view it is only really good at the reporting part and literally suck at the rest. The object-relational impedance mismatch is a well-known issue, that DDD values are hard to implement using OR mappers also seems to be common knowledge, and that backups are not exactly efficient or easy to make is also an issue.

Tags: , ,

Qi4j and domain model persistence

Rickard Öberg

The JavaZone 2009 conference is over, and although I couldn’t make it this year due to our project, StreamFlow, going into production soon, the Qi was definitely flowing there. I’ve been watching the videos from the conference (available here, and many kudos for making them available so soon), and there’s a number of presentations which either explicitly or implicitly relates to Qi4j. It seems that so many of the issues that Qi4j has been designed to deal with are things that are becoming known and annoying to a majority of developers. So, I’ll try to outline below just how the topics covered at JavaZone relate to Qi4j, and how Qi4j can help you deal with those problems.

Tags: , , ,

Add some polish to iPhone app start up

Fredrik Olsson

First impressions last, and the very first impression your users have of your iPhone application is the start up. First step is to have a nice Default.png, but not many words spilled on that one, it is well covered in Apple’s documentation. Creating a perfect Default.png is impossible, especially if you have different setup of [...]

Tags: , , , ,

Spring and load-time weaving of Neo4j-based domain objects

Mattias Ask

What do you do when your Spring configuration isn’t in charge of creating your objects that needs to be injected with stuff? This became a real problem for me when I tried doing some non-anemic domain object implementations persisted as Neo4j Nodes. I was playing around with creating a Twitter clone, in my opinion the [...]

Tags: , , , , ,

Mocking static methods in Java system classes

Johan Haleby

As you may already know PowerMock can be used to easily mock static methods which is normally not possible with standard mock frameworks such as EasyMock, JMock or Mockito. All you have to do is to use mockStatic in one of the PowerMock extension API’s as well as telling PowerMock to enable the class for [...]

Tags: , , , ,

Queued Background Tasks for Cocoa

Fredrik Olsson

The megahertz race is over, and instead we get more execution cores. This means that we as developers must make our applications parallel, in order to take advantage of the new performance. The easiest way to be parallel is to execute tasks in new threads, something that is useful also for lengthy but not resource [...]

Tags: , , , , , , , , , ,

Regular Expressions and Cocoa

Fredrik Olsson

Regular expressions is a powerful tool for solving many problems related to text. It can be misused as any good tool, but there are moments when they are the best solution for a given problem. At those moments the lack of regular expressions for Cocoa on Mac OS X and Cocoa Touch on iPhone OS [...]

Tags: , , , , , , , , ,

PowerMock Part 2

Johan Haleby

In JayView 17 we presented a short introduction to PowerMock, a framework that allows you to create automated tests for almost any code in isolation from its environment. In this article we’ll dig a bit deeper into PowerMock and explore the goals and more of its feature set. Background PowerMock is intended for developers who [...]

Tags: , , ,

JavaFX – Hands On

The JavaFX 1.0 release was launched in December 2008 after years of development. So what is it? Sun markets JavaFX as a Rich Internet Application (RIA) platform and a tools suite aimed both for developers and UI designers. In this sense JavaFX can be compared with Adobe Flash and Microsoft Silverlight. With JavaFX a new [...]

Tags: , , ,

Questioning “testable design”

Mattias Ask

After a discussion about PowerMock with @olabini on Twitter I felt I had to write a post on testability. The truth “Autonomous, re-runnable, code-based tests are objectivity good” has created a perceived truth, namely “Testable design is good design”. This assumption is incorrect. The phrase “testable design” is dependent of two things; the design of [...]

Tags: , , ,

Adding Sorted Inserts to Cocoa Arrays

Fredrik Olsson

NSArray and NSMutableArray have methods for sorting arrays, NSArray returns new sorted arrays and NSMutableArray can be sorted in place. The sort methods comes in three flavours; using a function, using a selector, or using an array of NSSortDescriptor objects. NSArray admits to sorts being a slow operation, and adds a method pair for comultive [...]

Tags: , , , , , ,

Bridging the Gap Between Java and Cocoa

Fredrik Olsson

Many Java developers are looking at new dynamic languages, such as Groovy and JRuby, mostly because of the freedom and rapid development that a dynamic language allows. Some of my colleagues are also looking at Cocoa and feel daunted at the sight of Objective-C. Here I will use a small example that is easy and [...]

Tags: , , , , , ,

UIToolbars in iPhone OS 2.x

Fredrik Olsson

The new release of iPhone OS 3.0 adds some nice API:s for managing a contextual toolbar. This is well needed as toolbars in the current iteration of iPhone OS is not only poorly documented, it is also quite hard to do right. So I will go over how to do toolbars the right way, for [...]

Tags: , , , , , , , ,