Java

First, a small update:

Those who read my last post, here, know that I was planning to use MVP with gwt-dispatch.

Well, at the time, GWTP seemed like an overhead and it included a fork of gwt-dispatch anyway so I thought MVP with gwt-dispatch would be lightweight and straight forward.

 

sefi 03/01/2012 - 18:46

In this article I'll go over two Java packages that allow to create specifications for automatic unit test generation. 

 

What does that mean? It means that instead of creating a unit test, you create a description of the properties that the unit under test must hold. A property is something like "the stack size after push is the size before plus 1". With regular unit tests we would assert this property by creating a specific test case (say, starting from an empty stack) and doing the operation. But then we might miss some corner cases. For eample, maybe our stack is backed by an array starting at size 10 and we forgot to code the array resizing. Then 'push' will work as expected for the first 10 items, but fail for the 11th. Our simple unit test might not try to push 10 items.

 

ittayd 24/08/2011 - 07:27

Here is a short article, discussing some reasons, why Scala may seem more complicated than it is to beginners.

 

I think, the most important item is the show-off factor. Not only in blogs, but also in code people try to demonstrate the most advanced Scala feature they learned recently.

 

For example, Scala creator Martin Odersky defines the lazy vals as a part of a library level. Yet, I saw a pure business logic code using lazy vals overrides to create a subclass polymorphism.

 

andrew 18/08/2011 - 10:03

It appears that many people, including decision makers, are not fully aware of important GWT abilities and limitations. Many features in recent releases of GWT and related projects can be real game changers for the developers and for the end users. Here I am going to address common misconceptions and provide solutions to common issues.

 

"GWT does not support browser history (back button, bookmarkable URLs)"

gabi 10/07/2011 - 08:13

 Mockito really helps when you want to make white box testing. In addition to testing the results of some code, you can make sure that the code makes necessary method calls during its execution. 

For example, the following method prints the current time:

public MyClass {
  public void printTime(PrintStream ps) {
    ps.print("Current time is: ");
    Date now=new Date();
    SimpleDateFormat sdf=new SimpleDateFormat("hh:mm");
    ps.print(sdf.format(now));
  }
}

Let's try to test this code. We want to make sure the code calls PrintStream 2 times, ignore the first call and check that the second one is in correct format: two digits, colon(:) and another two digits.

I started with writing a custom ArgumentMatcher just to check there is a semicolon in a string:

andrew 14/06/2011 - 18:33

Here is the presentation given at our last event about moving from Java to Scala.

 

The presentation show how Scala can be used instead of Java to get more concise and modular code gaining productivity and maintenance advantages. It use a simple Android application to show the transition. It touches simple Scala features that make us more productive as well as more advanced ones that make our code better.

 

 

 

 Here's the original presentation:

 

ittayd 22/05/2011 - 21:43

During the past 3 years, the Java language and the Java platform have steadily parted into two disjoint domains.

 

yifat 31/03/2011 - 12:54

Today I needed to test some rest services implemented with Jaxrs and Jersey, My intention was to have a fast running unit test that can be run on CI build and will test that the jaxrs+spring wiring, json serialization etc. don't break. All my resources are just calling other internal services, so I decided to deploy my rest resources and wire mock objects to them on an embedded jetty server.

I used spring annotations to wire everything up and all my resources look like that:

 

@Component("myResource")
@Path("/somepath")
public class SomeResource {

    @Autowired
    private mocktest.SomeService someService;
...

 

so the easy way to mock SomeService would be to just create an Easymock factory-method bean:

 

shalom 14/03/2011 - 00:26

 The goal of this tutorial is to modify the spring roo vote sample application (found in Roo's sample scripts directory), so the sample will now use Flex as it's interface. This tutorial was written during a Tikal Fuseday workshop on Spring Roo Flex Addon, by Haim Raman, Shay Gabay and Lior Boord.
 

Introduction

In recent years, conventional Java and other traditional software development methods are challenged by new development platforms. Ruby, Grails, Django and other platforms introduce a faster and simpler approach for Software development. The current Global recession only made these new methods more popular, in today's enterprise world, companies are looking for ways to cut development costs and are questing traditional methodologies.

 

About Spring Roo

liorb 24/02/2011 - 15:20

Spring has a nice feature, which is often overlooked: a bean with shorter life-cycle can be injected into a bean with a longer life-cycle. A classic example is singleton for MVC controller and a request-scope bean for DAL. This is achieved in Spring with defining a proxy bean like this:

 

<bean id="booksDao" class="my.dal.BooksDao" scope="request">
  <aop:scoped-proxy />
</bean>

<bean id="booksFacade" class="my.web.BooksFacade">
  <property name="dao" ref="booksDao"/>
</bean>

 

This way, booksDao can be accessible from any beans processing the request, and Spring will ensure it's the same instance during the same request, and different instance for different requests.

 

andrew 28/12/2010 - 17:26
Syndicate content