Sunday, November 27, 2011

Opportunities

A respected friend of mine identified current opportunities @IT sector as follows:


* Cloud infrastructure management as mentioned http://blog.xebia.com/2010/03/09/developing-and-deploying-java-on-middleware-and-in-the-cloud-rise-of-the-virtual-appliance/

* Mobile client interface and model driven development like http://www.ipfaces.org/

* Vertical frameworks as executed by http://pega.com/

* Big data and extracting value! http://techcrunch.com/2010/03/16/big-data-freedom/

Tuesday, March 09, 2010

JMeter scripts for continuous integration


A client needed to move from Oracle to Microsoft Sql Server and wanted to make sure MS sql server will work as fast as Oracle does.
We used JMeter to record various scenarios from our web application for benchmarking against two different databases.

After tuning sql server a bit we have seen dramatic performance improvements and by re-running our recorded tests we could keep track of our progress.

Jmeter scripts can be executed from ant and maven builds. It is very good idea to run jmeter scripts as part of continuous integration process at least once a day.

JMeter allows inserting assertions against the response you get back from server by regular expression matching. So in theory scripts can verify json, xml responses. As a result, you can position those scripts as integration tests as well as performance tests.


Hudson has a performance plugin that can execute jmeter tests and report performance and robustness trend of the application.
This way you can measure performance trends of stable development environments (e.g pre-production servers) as development patches are applied to them. 

One easy way to record web application interaction and place assertions against html responses is to use Badboy.
BadBoy is an  capture/replay interface which can export as jmeter scripts.


There are many ways to test/benchmark request-response exchange, this is just one of them. What other tools & techniques do you use to track performance and stability trend of web applications?

Monday, March 01, 2010

Job Opportunity in Istanbul,TR

A dear friend asked me to pass on the word. 


If you are in Istanbul and want to work with a very good team on latest java technologies to create state-of-the-art telecom software.

Here is your chance.

 

Sector: Telecom.

  

Experience: 2-4

Specialities:  


- javaEE
- JSF
- EJB3
- Quartz
- GridGain (optional)
- jboss 5.X
- web service(metro 1.5+)


Send resumes to jobs.istanbul@gmail.com 


Thursday, February 25, 2010

Code Katas



A Code Kata is an exercise in writing code preferably in test driven way, which you do repeat periodically.

There are very good examples of them around the Internet. 


It generally takes 15 to 20 minutes to finish for the first time, after a few cycles duration goes down by almost by half .
Every time I repeat , I find new shortcuts in my development environment and a few things to do differently.

Here are some of my favorites.


I prefer Java but intend to write some of them in Scala Ruby and Groovy.

Wednesday, February 17, 2010

Virtual development environments


Using virtual machines to maintain development environments ( development ide to application server config) is becoming a common practice.
8-core cpus, 4+ gb rams and 64 bit operating systems allow running guest operating systems without a lot of performance penalties.

What should be in a baseline image?

  • Notepad alternative
  • Continuous integration server running unit tests of your project (e.g Hudson)
  • IDE (Eclipse or Netbeans) and plugins
  • Static code analyzers with customized ruleset of your team (integrated with IDE) e.g PMD, FindBugs
  • Application server (integrated with IDE) (Glassfish)
  • Database server with initial data loaded.
  • Load generator with sample scenarios (e.g Apache Jmeter)
  • Cache server (memcached)
  • Any other frameworks your project needs (e.g Grails)
  • SQL client (depends on your db)
  • Source control client (SVN or git client)


There are a lot of advantages
1- Common virtual machine image to get new members of team running up in short time.
2- No need to change settings between clients and projects

For virtualization, I prefer VirtualBox. Vmware is another alternative and so is Parallels in Mac OS X.

What other tools do you install as baseline for virtual systems?







Tuesday, February 16, 2010

Single responsibility principle

Single responsibility principle

Recently i needed to compile our all jasper-report files during application start-up.
I was modifying existing code-base to enable precompiling xml reports to binary .jreport files.

It was simple enough, traverse all *.jrxml files at a certain directory and use net.sf.jasperreports.engine.JasperCompileManager to do the actual compiling.

Here is how i traversed all files under a directory.

    private void visitAllFiles(File dir)  {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
visitAllFiles(new File(dir, children[i]));
}
} else {
//doSomething();
}
}


Here is what is wrong with this version.

The infrastructure logic to traverse the files and business logic to compile reports resides in same class.
If i needed traverse files for something else (for example to backup old compiled reports) i would need to duplicate infrastructure logic.
It seems this class is trying to do too many things. I separated this class to a reusable FileCrawler and FileVisitor.
 
public interface FileVisitor {
void visit(File fileToProcess) ;
}

FileCrawler takes a visitor and calls visit method for each file it encounters.

     
public FileCrawler(final File root, final FileVisitor visitor) {
this.visitor = visitor;
}

private void visitAllFiles(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
visitAllFiles(new File(dir, children[i]));
}
} else {
visitor.visit(dir);
}
}

Usage is as follows:

  new FileCrawler(new File(this.cacheFilePath), new ReportCompiler()).start();


ReportCompiler implements FileVisitor and looks like as follows:


public void visit(File fileToProcess)  {
String name = fileToProcess.getName();
if (name.endsWith(".jrxml")){
compileReport(fileToProcess.getParent(),name);
}
}

Now i can  use anonymous inner classes to create simple reusable directory traversing logic.

new FileCrawler (new File (root), new FileVisitor() {
public void visit(File fileToProcess) {
String name = fileToProcess.getName();
if (name.endsWith(".jreport")){
fileToProcess.delete();
}
}
});


Monday, November 09, 2009

stackoverflow clones

After the success of stackoverflow, many applications with similar concepts have emerged.
while some of the chinese sites have even used the same design, some of the web applications are geniune attempts to add value.
O'Reilly with its vast knowledge base of everything related computers is trying to take advantage of it with O'Reilly Answers concept.

What other sites do you see as a stackoverflow competitor?

Update here is once stackoverflow wanna be in Turkish
http://www.sonsuzdongu.net/

Wednesday, November 04, 2009

Distributed Processing

Processing log data and extracting valuable insight from it will not be straightforward. Fortunately there are a few pointers to help.

1- Commonj Work manager API
CommonJ is a BEA and IBM joint specification that provides a standard for executing concurrent tasks in a JEE environment. It has support for the Master/Worker pattern in its WorkManager API. It has open source implementations too.

2- Master-worker pattern can be easily distributed with Terracota infrastructure.

Tuesday, November 03, 2009

High Performance XML Processing

In my current project we will probably need hardware XML accelerator to process many millions of xml messages..
There is an ongoing EU project in which Cybersoft participates.
IBM can supply the hardware XML processor via DataPower

system.out.println

Note to myself:
You should never use System.out.println in production code.. See the synchronized block out there.


public void println(String x) {
synchronized (this) {
print(x);
newLine();
}
}

Saturday, October 31, 2009

Back to Cybersoft

Last week i switched back to my old company from Turkcell to Cybersoft.
This was part of a strategic decision to move to banking domain field.
My first task is to create a centralized audit log management system.
Our aim is to do fraud detection in real time by analyzing data coming from different layers of system (client/server/db)
BDDK (the regulator of the banking system) also enforces such a system to be in place well before 2012.
Performance and scalability challenges ahead, really interesting times indeed..

Friday, October 30, 2009

Grails

I am using Grails since 1.0 release.
After being acquired by SpringSource, the future is looking bright for the framework.
It has a great plugin community.
Unfortunately there are almost no Turkish documentation on it.
In the near future i will launch a series of tutorials on Groovy/grails in Turkish.

Friday, March 07, 2008

Turkish unicode characters

I have had a hard time finding these.. Here i list them mainly for my later reference.
I hope someone finds it useful as well..
* ğ - \u011f
* Ğ - \u011e
* ı - \u0131
* İ - \u0130
* ö - \u00f6
* Ö - \u00d6
* ü - \u00fc
* Ü - \u00dc
* ş - \u015f
* Ş - \u015e
* ç - \u00e7
* Ç - \u00c7

Update: Thanks to my friend Oğuz I have corrected last two entries..

Tuesday, September 11, 2007

One-JAR

A friend asked if he could produce a single jar file with all required libraries packed inside it.
One-Jar does a good job of it.
It is easy to work with it from Eclipse too, thanks to Fat Jar plugin.

Tuesday, July 17, 2007

Managing user expectations

Managing user expectations is really important skill at every level of your career.

At the beginning of a career, you will most likely to answer the ultimate question of
"How long will it take this to finish ?" type of questions. Your manager will ask this to you.

Later as a consultant you will need to answer same question to clients, or as a manager you will need to come up with an answer for your senior manager.

As an entrepreneur you will need to answer this crucial question for cost estimation and bidding.


How long will it take? and by what percent will it be finished?
Should i put an beta version out and improve it as customers use it?
or wait for an stable 1.0 release?

At the root of all these questions lies the expectation management.

Here are some tips i have been employing when i need to answer how long it will take?

  • Try to judge from previous similar experience, if you wrote down your previous work allocation via time sheets on the average you know how long it will take
  • Do a quick POC type development which will not take more than a few days if possible
  • Do prototyping of important use cases and features, (important being defined by the customer) and try to estimate from that knowledge
  • If there are external stakeholders you can't control, estimate with relativity of their work. i.e It should take no more than a week, after we receive design templates from XYZ.
  • If possible, Slice the project to little periods, try to keep quality, time constant and vary the features. i.e We will work on these features for a month. We may not finish all features but we will keep our quality metrics to this level. If you are not satisfied with our work, you can always cancel the contract.
Note that the last strategy is not for fixed price projects. But it works because contractor will work honest to get the remaining big portion of the project. It shields the bidder from excessive unpaid change requests. And you can morph to fixed price later, after unknowns are eliminated.

Also last one has the nice feature of "fail fast". If a project is doomed to fail, it will fail in the first one little slice..

And during project implementation:
  • Don't present the work you are doing as too easy or too hard. In other words, communicate clearly.
  • Don't ever demo a feature complete UI early, because users will expect much more complex screens at the end. This is physiological. Instead show some cool features and build some excitement.
  • Always safe estimate a little more than it will take, this way you will always finish before time and earn some credits.
  • Never overestimate with a huge margin, next time they will not believe and your estimations will be halved by customer or manager. You will lose credibility once and for all.

What are your suggestions for estimating how long it will take?

Monday, July 16, 2007

Accessing dotted attributes from JSTL EL

One of my friends was in trouble with accessing scope attributes from JSTL expression language.
He wanted to use <c:out value="${myDomain.myObject}"></c:out>, to access an object under the key of "myDomain.myObject"

EL tries to retrieve an object under the myDomain key and then tries to invoke getMyObject() on that object. Obviously that wasnt working.

There is no standart way of accessing such attributes. But if you know which scope your object lives in, you can access like this.

<c:out value="${sessionScope['myDomain.myObject']}" />

A while ago Gavin King blogged about his EE6 wishlist, i add this one to my wishlist...

Using the right DOCTYPE

I have been busy updating the look and feel of an extra-net application.
I was using corporate id guidelines, so it wasn't a very creative process at all.
I have tried to use CSS as much as possible without resorting to tables for layout.

Apparently declaring doctypes is very important for all CSS/layout configuration to work properly.

Wednesday, July 11, 2007

Form design with CSS

I say enough to table based form designs. It is quite shocking to learn that you have to do lots of hacks to get form elements aligned properly across all browsers.
Still the outcome is beatiful.

5 tools you can't live without

Lately I am doing some web application restyling, cssing. I find myself using more and more of these tools.

There are some more useful utilities in the link i have included.

Friday, June 29, 2007

Technical debt

Lately i am paying some technical debts in a project about to go live in a few weeks.
I can easily spot hacked code by following below placeholders.
//FIXME: Some explanation
//TODO: Optimize here if possible
//TEST: Test this condition with respect to x and y.

Functional test reports often point to unreliable piece of code too. Using a bug tracker really helps.