Category: TheProject

codingI’ve been fairly quiet on the blog the past two weeks. This has been because I have been head down in code catching up from the holidays and being sick. I know all to well how abstract and vague I’ve been on what The Project is. I’m still shooting for a grand unveiling upon the ides of March. (March 15 for those who read not the Shakespeare)

I however do not want to be without any information. So I decided to play the magnifier game. This is the game where you show someone a picture of a common object through a magnifying glass and let them guess what it is they are looking at. Granted, that’s not my intent. I know what I’m showing is intentionally obfuscated to hide The Project’s intent.

However, I want to show a checkin from one of the classes that I did today to talk about what’s going on.

I’ve make no secret that this project uses a database to manage the content and Java and Tomcat to serve as a buffer to clients. Today, I am working on the database upload abstract class. In revamping my Java Servlets this past week, I have managed to completely abstract the query command class to the point that I can create any pre-packaged SQL query on the database into a 4 line subclass. This subclass can handle variant queries, compares, subqueries, and most importantly documentation on the return. This work made me very happy.

In pushing data up to the database there is more work needed. I have to verify that the call is including the correct information. I have to make sure that the subclasses have defined the necessary info to check. (So subclasses will be closer to 10 lines instead of 4)

Effectively, a push command should identify the table in the database, the usable column names, the required column names. And of course error check and return the response in a consumable way.

Below is my checkin comments from today’s abstract Class work. (Note there are redactions)

(Ah, the fun of Java)

imports java.util.List
adds ivars
	MUST BE OVERRIDDEN List requiredHeaders
	MUST BE OVERRIDDEN List usableHeaders
	String sqlQueryHeaders (for building sql update)
	String sqlQueryValues (for building sql update)
doSQLQuery() now doSQL()
	setRC not setRS with executeUpdate instead of executeQuery
	Sends a formatted json error response (put, not get)
validateSubClass() (new)
	Checks to see that there is at least 1 usableHeaders
	Checks to see that there are no more required headers than usable headers
	Checks that all required Headers are in usable Headers
	Checks that there is a table conversion equiv in getDbaseTable() {below}
	Throws Exception (Programming error) if any of these cases fail.
validateRequest() (new)
	Verifies that required headers are in the request http Header
	Returns first missing required header if failure
processHeaderPair() (new)
	examines each HTTP header pair
	searches for headers that are: Package.Command.usableHeader
	converts them into caseCorrected usableHeader and Value
	Appends them into Strings for use in SQL Update request
getDbaseTable() (new)
	converts servlet full DNS name into table in Database
	returns null if not set.
doPost() now doPut()
	Adds failNote as a return from validateRequest()
	Calls validateSubclass()
	Calls and evaluates validateRequest()
	Runs ProcessHeader() while iteration headers
	Builds SQLQuery (Should be update)
	Calls doSQL() and evaluates
	re-Enables SqlResult display in output
	ErrorIn -> ErrorLoc
	Shows failNote

On top of this, since you can’t test a PUT command in a browser; I’ve had to write a mini Putter app on my Mac. Let me assure you, hopping back and forth between Cocoa for OS X in Xcode and Java for Servlets in Eclipse can be a bit of a mind scramble.

This has been a personally hard week for The Project. Iin moving the data structures to MySQL as a database I had to also start developing Java servlet code. The reason for this is that it creates both the ability to have a Web-API for any number of clients: iOS, Android, Win, Mac, etc… while at the same time affording more ease for Web functions.

mgbUnfortunately my Java and Servlet knowledge were (and likely are) still lacking. The problem is that when you start a new programming environment you basically create sample code to test what you are trying to write and then adjust that code as you see success. Then you build on top of that. This sounds like a good idea at first and then you realise, that you are in fact building an upside down pyramid.

You learn one thing and you carefully build on top of it. This lets you learn a few more things so you balance them on top of the one thing you started with.  At some point you have to realise that you can’t build any higher because it’s all balancing act. This is where architecture comes in. Architecture takes the tools and designs a strong foundation. It designs a good skeleton and lets you put things where they best fit in.

All this CS theory sounds great in general; but at the same time you are trying to get a product done. This past Tuesday I hit a roadblock. The way I had put my Java class together, there was no easy way to add the next function. For those with understanding; I was dumping EVERYTHING into one class. I’ve been doing Object Oriented Code for a VERY long time. I knew how wrong my code was (in design) but it worked and got what I needed done.

So I was left with the very hard process of:

“Do I keep shoe horning in, to get a working version OR do I use what I have to build into something designed from scratch and put me back about a week?” This is the ‘Ooh, Shiny’ that as an engineer it’s very easy to get blown away by.

  • The project started with a client and hand build data. (Working on the client)
  • Then the data moved to a database. (Drop client work on MySQL)
  • Need to add data remotely to database (Lock in database, make data client)
  • Now a connector was needed between the clients and the database. (Web service, go to Tomcat, Java, Eclipse, learn new tech)

Of course the actual product client hasn’t moved in two weeks as far as code. The data entry client ramped up last week, but the connectors aren’t there.  So, the fear is not putting so much into one that we don’t move forward with the actual Gem of the lot.  This week I had to decide… how do I proceed and will the decision be right or wrong.

On the one hand it was ‘keep pushing forward and working around the problems being created.’ On the other it was ‘Stop, learn, regroup, rewrite, take the hit.’ And this decision was going to leave me unhappy due to the cons on both sides.

After two days of being in really crappy head-space over this, I realise that this is my product and unlike many of the companies I have coded for: I want it RIGHT. I do NOT want it RIGHT NOW. The dates I set for release are still somewhat arbitrary. Better I be happy with what is under the hood.

Digression. When I was 21 years old my father bought me a 1970’s red MGB convertible (Similar picture above). This thing was beautiful. It was missing some mirrors and had no seat belts (some did.) My father managed to snag this beauty for $800. My dad also never actually looked at the condition of the car. When we opened the hood we saw the electrical had been ripped out and replaced with speaker wire. Half the gauges didn’t work on the dashboard (including Oil, temp, and Fuel) The car also didn’t have a starter button.  I could ramble on telling stories about this car that I eventually named Truddi due to the car’s penchant for having multiple personalities. The point is that the car looked beautiful, but it had horrible guts. There is the right way to wire a car and a wrong way.

While you may think, “Well, aren’t you just ripping out the wiring and redoing it?” The metaphor here is that I am making sure that what I put in there from the start is correct, and not just a pretty outside with horrid innards that don’t belong. And you can believe me that I’ve been asking myself these questions and fighting both sides of the battle.

(long sigh) Well, enough procrastination. Time to design and write some Java from scratch. (But profit from a distributable JAR)

chattering-teethThis weak (sic) has been full of excitement. Thanks to the surgery which left me doped pretty much all week, I’ve gotten far less done than I wanted to. This is right down to having to push off an appointment from Friday to Monday as well as completely missing important mail from my land lady. There have been some highlights however.

  1. While I’m likely not using them correctly, I’m navigating Tomcat, Java, and Eclipse more efficiently now.
  2. I’ve done my first servlet code to push data back to the database from a client
  3. I’ve been working on a data entry app to make adding data easier. (It’s crappy, but it has some nice features including db lookup)
  4. I may have a potential Product Manager to start working with arranging the business end of thing.

On the agenda (aside from catching up on email and meetings)

  1. Data Entry Client
    1. Add versioning info to the client 02104.01.12..2250
    2. Add the data client to the continuous automation 02104.01.12..2250
    3. Gather the collected data for push back to the server
    4. Add a <strike>redacted</strike> to let me see where a <strike>redacted</strike> is.
  2. Servlet
    1. Finish the data PUT calls for posting data to the DB
    2. Learn how to automate the checkin of java code with CI to push it directly to the Tomcat machine.
  3. Client
    1. Use the new data managed in the DB to populate the existing interfaces
    2. Disable unused interfaces for Alpha distribution (keeping active for dev dist)

As you can see, the week ahead is fairly full code wise.

Time and code marches on!

obstructions-logoWith surgery on Tuesday coupled with the winter blast closing all local schools for two days; things slowed down this week for the project. I wish things were moving faster. Personally, I wish I could do more but I take each day as it comes. This week I started on improving the data entry system for our new data bases. Due to the complexity of the data making a data entry system is going a little more slowly than I expected.

I did however do an expansion on the Java Servlet to pull from one specific table. The code to pull and serve the data went extremely quickly. So, there’s a growing hope for me and my java skills. I’d still say at this point I’m a dangerous n00b who’s code will need to be rewritten, but it does the job.

Hopefully tomorrow I’m back up to full speed.

I’m back to wandering around the house in a somewhat tipsy manner. The tonne of Halcion they put me on wore off. I slept from 3 until 9:30. Now I have a mouthful of temporary apparatus. Smile picture in a few days when I am less self-conscious.

Obviously there is hunger (having to eaten since 9pm last night)

I had some wonton soup, a pepsi, and am now attempting mango sorbet.

We’ll see how this goes.

For those curious about The Project. The house rule was as follows:

  1. You may blog
  2. You may not drive
  3. You WILL NOT code.

SO back to that tomorrow.