Archive

Posts Tagged ‘Java’

Unit testing the data access layer

September 30th, 2007 7 comments

Unit testing can be difficult sometimes. In some cases, you need to refactor your code-under-test to make it more testable; in other cases, you need to apply some special techniques into your test code so that it can do what you want; and in the worst cases, you can’t think of any such techniques nor are able to refactor the production code and thus, don’t write any test at all. It’s in my experience working with many teams applying unit testing that they often have troubles writing tests for the data access layer (DAL), UI layer, service interface layer, and multi-threading code, mostly because they are not aware of the techniques for doing that. That is not surprisingly difficult to understand though, business logic is much more intuitive and straight-forward to be tested and every single article or book out there will have examples writing test for the business logic firstly.

In this blog entry, I will explore some techniques of testing the data access layer. While it won’t be very comprehensive (I think an entire book can be written just to explore in details all facets of database unit testing), I hope there is enough of topics covered for you to explore more. Read more…

Steve Yegge on the Next Big Language

February 13th, 2007 Comments off

What Steve Yegge considers the Next Big Language.  Sound like

  • Ruby + (Java || C# 1.x/2.0)
  • (JRuby || Groovy || Ruby.NET) + good_tools (esp. IDE)
  • C# 3.0 && dynamic_typing (not just type inference) && more_syntactic_sugar (return multiple values, object-literal syntax for hashmap etc.)

Checked Exception

January 21st, 2007 2 comments

Whether checked exception is good or bad is such a big debate which is currently still not agreed upon. Do a google with the keywords “checked exception”, you’ll see a bunch of stuffs to read. I’ll do a quick summary on the key things which are usually used as arguments by the folks on the net Read more…

The Senior X-Language Developer

January 12th, 2007 4 comments

Lately, I’ve seen some job posts in the local newspapers which seek for senior .NET developers and senior Java developer who have at least 4 years of experience in .NET/Java, and feel a little bit dissatisfied with them. Read more…

Java and .NET Generics

January 10th, 2007 14 comments

Java 5.0 and .NET 2.0 both support generic types, however, the implementations of generic in these platforms are different. Java makes use of a technique called “code sharing” in which there is just one type to represent all generic versions of that type, for example: ArrayList<Integer> and ArrayList<String> are both compiled down to ArrayList as the compiler perform erasure on generic types. On the other hand, .NET makes use of “JIT code specialization” technique in which there is a separate run-time representation of each version of a generic type (i.e. List<int> and List<string> both have unique representations at run-time). Read more…