Saturday, January 24, 2009

Notes from Houston Techfest, Part 1

Notes from Houston Techfest:

Keynote Sang Shin from Sun Microsystems
Topic: Having fun in building Web applications with Ruby/JRuby/Rails

Notes: Not real instested in Ruby or JRuby. My Personal feelings is this is a fad language and will disappear the way of cobol in a few years. However, Sang gave a good presentation about the Ruby basics and how to get started doing web development. His web site http://www.javapassion.com/ looks like it has jump start guide. I just don't see this as mature a development framework as Spring or other DI design patterns.

--------------------------------------------
The next session that I attended was by Brian K Oxley from JP Morgan
http://binkley.blogspot.com/
Topic: Fluent Interfaces for testing in Java

Basically this shows how to add testing to Java code using code that look like english sentences. Proponent of static imports.

org.hamcrest.matchers testing library looks promising. Need to check into that library more.

Building fluent interfaces promotes the Builder Pattern to implement a testing interface for the code. So this creates an additional layer between the use case test and the code to be tested. This layer abstracts the test building so more syntactically correct English can be used to create the tests.


Even though I can understand the benefits for creating a more English like structure to create the tests it looks like with this additional layer of code that there is more code to test. What tests the test interface and what if the test interface is wrong or introduces a new bug that hides a bug in the code. This can happen in single level testing also but I'm not convinced that adding an additional layer to the testing will streamline code testing.

Brian also plugged Ron Coffin from Improving Enterprises


---------------------------------

William J Ferris
Topic: Topics in ava Concurrency

Recommended:
Brian Goetz, Java Concurrency in Practice
Herb Sutter, DDJ March 05: Free Lunch is Over

Why do we need to work on concurrency. Increasing need for threading because of multiple cores. Biggest threat to programming concurrency race condition when you expect one thread to finish first all the time or one thread accesses a object after another thread read it but before it writes to it. Other threats are deadlock and starvation. Deadlock is when two or more resources are waiting on resources. Starvation is when a thread cannot get cpu time.

To fix race condition: Concurrent Solutons
1. Elimination: Don't share the object if possible
2. Dynamic Exclusion: Use locks and barriers
3. Structural Exclusion: Code with immutable objects and confinement,isolate variables to specific threads

#2 Locks Intrinsic use synchronized keyword, Synchronized locks on getter and setters doesn't work!

Explicit locks java.util.concurrency.locks

Atomic new in java. Creates thread safe objects. Uses new methods to access the object.

Atomic best preforming, then explicit locks. Synchronized and fair share model are the slowest when more threads are added.

Maps are not thread safe, ConcurrentMap is threadsafe.




---------------------------------
Next was lunch -> See part 2....

No comments: