Wednesday, January 27, 2010

Business Primitives in Software Development

Great introduction to Business Primitives when designing your applications:

The basic premise is to not only get you speaking the language of the business, but to make your method signatures easier to understand. For example, in a financial application that has a pricing class you might see a method signature similar to the following:
double getPrice(String)

Without diving into the source or docs, it's not immediately clear what the parameter represents. It could be a ticker, it could be a CUSIP. By creating a single value primitive such as Ticker, the method signature becomes:
double getPrice(Ticker)

Wednesday, January 13, 2010

SQL Server 2008 on Windows 7 - Restart Required

An install of SQL Server 2008 on my new Windows 7 64-bit Pro setup was going great until I went to install SP1. The update check failed kept failing with Restart Required even I rebooted several times.

I decided to uninstall the 64-bit version of SQL Server and try the 32-bit version to see if the same issue is present. It may be but I couldn't even uninstall. Same error. Here how to fix:

Open Regedit.
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Rename PendingFileRenameOperations to PendingFileRenameOperations2

Don't restart. Proceed with the SP1 install or uninstall.

Thursday, January 07, 2010

Solving Errors with Netbeans Faces 2.0 CRUD Tutorial

Finally had some time to sit and go through what's new in Java EE 6. I opted for the latest Netbeans version 6.8 with the bundled Glassfish v3 app server. The quickest way to get started.

There is a lot of good documentation available on-line as well as several tutorials exploring various feature of the new platform. The first that caught my eye was Generating a JavaServer Faces 2.0 CRUD Application from a Database

The tutorial runs you through how to generate a lot of boilerplate code for a standard crud app in Netbeans that I was really excited to see, having been spoiled from what's available in VS in the .Net world. I came across a few minor issues preventing the sample app from fully working. If these errors look familiar, here's how to fix them.

The first results from trying to create or edit a Client:

An Error Occurred:

clientPK.clientName

- Stack Trace

java.lang.IllegalArgumentException: clientPK.clientName
...
This results from the string "clientPK.clientName being used in the id fields if h:inputText

h:inputtext id="clientPK.clientName" value="#{clientController.selected.clientPK.clientName}" title="#{bundle.EditClientTitle_clientPK_clientName}" required="true" requiredMessage="#{bundle.EditClientRequiredMessage_clientPK_clientName}"/>


Change this id to clientName. Also change it in the line above in the h:outputLabel. Make similar changes for ClientDepartmentNumber in the same file. There is a similiar change required in project/Edit.xhtml and project/Create.xhtml for projectName

This got me to the client create screen, but when trying to save, I was greeted with

An Error Occurred:

/client/Create.xhtml @19,256 value="#{clientController.selected.clientPK.clientName}": Target Unreachable, 'null' returned null
The 'null' here is clientPK within the selected client entity in the client controller. The prepareCreate in the clientController creates a new Client but the contained clientPK remains null. I would typically check for this condition in the accessor and create the object if null, and actually still do. Looking at the generated code I found a constructor that takes a clientPK as a parameter, so simply changing the instantiation in clientController.prepareCreate to:
current = new Client(new ClientPK());
took care of it.

Here is an excellent 3 part overview of what's new in Java EE 6:


Saturday, August 15, 2009

UI Design Is Not A Spec!

Came across another one of your typical articles from the "Design World", on how us developers are so difficult to work with, and just don't "get it"

http://www.smashingmagazine.com/2009/08/14/how-to-effectively-communicate-with-developers/

Now I have nothing against the author personally. I'm sure his design are fabulous. But judging from some of the comments, I would say most who call themselves designers are the ones who don't "get it". Project spec through UI design doesn't work. Period. No successful large project I have ever worked started with a designer handing over some pretty mockup while at the same time saying, "Here's what it needs to do." Give me a break.

A good developer understands the entire project life cycle, including where the UI design fits in. A good developer will also not touch a project in which a designer insists they code to their UI, which is why I imagine the author has so many problems with developers that don't "get it".

At the same time, a good designer understands a UI mockup is no substitute for a functional spec. I admire the spirit of the article, but it's just all wrong.

Friday, July 17, 2009

Elance Hacked!

Just got my copy of the email that's spreading around to eLancers. I'm assuming anyone and everyone out there with an eLance account will get it, because they apparently don't know exactly who was affected, or what was taken.

Curious though that they claim in the same email that "This incident did NOT involve any credit card, bank account, social security or tax ID numbers"

How can that be eLance? Even if you have identified THIS breach, you security is obviously lacking and it's doubtful this is your only security hole. More likely it's your only known security hole.

Thursday, July 09, 2009

18M Website Redesign?

Your tax dollars hard at work again. $18,000,000 for a website? Check them zeros, yeah that's 18 MILLION!

Since it appears that the company awarded the contract, Smartronix, does not even do web development according to their own site, I guess they'll be outsourcing the work. Overseas I presume.

Hey Smartronix, if your looking for help pulling this off you can hire me, and each member of my team for only $18,000.oo per hour. We'll work full time on it for say um, 2 months? You'll still make a nice profit. What do you say?

Wednesday, July 08, 2009

Google's Chrome OS

I say it's about time Google. I guess it took the rise of the netbook to finally make this happen. Web apps are and have been the future for how we interact with the world outside of the corporate cube.

It will be nice when that day comes that I don't have to endure a two minute boot of a PC just to get to google and check some stats.

I doubt though this will put Microsoft out of business. Competition will force them to adapt, like they always do when threatened. Look at the stagnation of IE 6 until Firefox threatened, then bam, IE7, IE 8 within what a year?

Maybe we'll finally get that lightweight Windows desktop OS they have been promising for like, ever. Competition is a good thing.