tirsdag 15. juli 2008

UI checklists

Search checklist from adaptivepath.

My own checklist for Matisse

Once a new component is added to UI form, edit its properties:
  • Code-tab: Variable name
  • Code-tab: Serialize to
  • Properties-tab: Name
  • Properties-tab: Label
  • Properties-tab: Accesible name
  • Properties-tab: tooltipText
  • Properties-tab: text
  • Properties-tab: sizing
  • Properties-tab: border
  • Properties-tab: turn off autoCreateColumnsFromModel for JTables
  • When setting Action: remember to hook off "Background task".

torsdag 19. juni 2008

Software maintenance is...

  • Intellectually complex - it requires innovation while placing severe constraints on the innovator
  • Technically difficult - the maintainer must be able to work with a concept and a design and its code all at the same time
  • Unfair - the maintainer never gets all the things the maintainer needs, such as documentation
  • No-win - the maintainer only sees people who have problems
  • Dirty work - the maintainer must work at the grubby level of detailed coding
  • Living in the past - the code was probably written by someone else before they got good at it
  • Conservative - the going motto for maintenance is "if it ain't broke, don't fix it"

Software maintenance is pretty complex, challenging stuff.

tirsdag 20. mai 2008

Architecture: Swing, Maven2, NetBeans etc.

Development setup

  • Maven
  • NetBeans, plugins

Modules: swing-gui (client), service (ejb, ws, xml-dummies), model, parent
  • Unit tests, test-data
  • Code harness
  • Libraries / Frameworks: SWAF, Hibernate

Maven in NetBeans

I use NetBeans (6.1 ) with maven plugin, as described here. should maybe read 10 Steps to Happiness with Maven and the NetBeans Platform.
Maven is found on Apache site.

Swing

I found a host of useful examples on java2s, (with Outline=TreeTable examples) and in "Swing Hacks". I use some stuff from SwingLabs, check documentation.

MVC + Swing

I use Swing Application Framework, note that this Framework is "bleeding edge" according to self, but seeing it was used by Matisse NetBeans plugin, I concluded I might as well try it. (Alternatives: Eclipse RCP, NetBeans Platform, and Spring RCP (cf intro) and JGoodies).
I was pointed to Swing Fuse by this article on DI with Swing Fuse. Worth also to look up Google guice.

SDN has a nice article on Java SE Application Design With MVC.
On undo/redo from JavaWorld, or MVC-alternative.
Check Holub's More on getters and setters.

Unit testing

Unit testing the Swing GUI may not be worthwile, cf. jfcUnit Tests Swing GUIs (sidebar).
Injection of test data can be done with Castor.

More

Check the Capability Pattern.


torsdag 8. mai 2008

JNDI in JUnit tests

Sun har også en provider som kan brukes - se jndi-tutorial.
I ended up using Simple-JNDI - simple-jndi, thanks to:
James Strachan's Weblog
Injecting Constants as Spring Bean Properties | Unicon

My setup for lookup-key "java:comp/env/jdbc/ds":

jndi.properties:
java.naming.factory.initial=org.osjava.sj.SimpleContextFactory
org.osjava.sj.root=${project.build.directory}\\test-classes\\jndi
org.osjava.sj.colon.replace=--
org.osjava.sj.delimiter=/

src/test/resources/jndi/java--comp/env/jdbc/ds.properties:
type=javax.sql.DataSource
driver=oracle.jdbc.OracleDriver
url=${db.url}
user=${db.user}
password=${db.password}