Posts

Eclipse project explorer label decorations - Type Icons

There is a simple way to see decorations for Interfaces, Abstract Classes, Enums, etc in the Project Explorer. Goto Window : Preferences Search for decorations Click on General : Appearance : Label Decorations Check Java Type Indicator on and apply You will now see the decorations in the Project Explorer

Is the API RESTful

REST APIs must be hypertext-driven RESTful URI design

Eclipse JBoss/WebLogic debugging and hotswap

How to configure Eclipse debugging and hotswap for JBoss and WebLogic Excerpt: Lastly, tell Eclipse not to erase other files in the output folder every time it builds the project. While still in Preferences navigate to Java | Compiler | Building and uncheck Scrub output folders when cleaning projects. That's it. Now every time you save a Java file, Eclipse will recompile it and JBoss will reload it. WebLogic hot swap

Terracotta vs. Hibernate

After a side-by-side implementation comparison, where ACID Transactions and persistence were not strictly required, utilizing Terracotta required ~1/4 the LOC implementation of a Hibernate implementation. Terracotta required ~5 implementaion files vs. ~14 implementation files for Hibernate - several were related to DDL. Hibernate required DDL, mapping files or annotations, DAOs, dbUnit test data, and integration tests. Terracotta required POJOs and plain unit tests instead of the integration tests necessary for Hibernate. To avoid surprises, it is generally good practice to thoroughly test all Hibernate mappings and test against the target database. Also significant, is the fact that the Terracotta implementation doesn't unnecessarily tax the least scalable component of the system; the database.

Remote windows shutdown/restart

c:> shutdown -? c:> shutdown -r -f -m \\<Computer> -t 1 -c "some message" Restart in 1 second forcing applications to close

Windows Tools

Cygwin howto OpenSSH and X VNC is almost always the wrong solution for connecting to a Linux box. $ ssh -X -C -c blowfish username@linuxbox gnome-panel cygwin sshd install cygwin ssh install RKTools - alternative to cygwin TCPView - Sysinternals Windows Telnet server Telnet client - Java Applet The Java Telnet Application

Favor composition over inheritance

I have take Josh Bloch’s recommendations to heart: • Item 15 minimize mutability • Item 16 favor composition over inheritance • Close/limit the API as much as possible and open/expose it only as necessary • Design for inheritance and document it or disallow it I have created very few class inheritance hierarchies over the years – except when I was heavily doing swing/UI work. I used to create lots of abstract classes for common behavior; however, I have since switched to creating interface inheritance hierarchies and utilizing composition. While it is slightly more work except for testing, I can’t recall any particular situation where composition hasn’t worked. However, there are certainly situations where a class inheritance hierarchy is more ideal and I would still favor it over composition. I have specifically found composition to be excellent for TDD. I can test the parent class fully. Later when I compose, I use a mock and just test the pass-through methods and the new behavior...