Pages

December 21, 2007

Embedded SQL vs. Stored Procedures

I've been working on a small pet project lately that involves storing and retrieving data from a database. I have about 10 - 12 different queries that have been written to handle all of the data. Initially I began embedding all of the queries into my code and using the normal JDBC PreparedStatements to make all of the calls. Then I needed to make a few changes to data model and corresponding DB schema. I had to go back into each piece of code that contained an embedded SQL statement and make updates to account for my data changes. This was a serious pain in the @$$ as I spent a couple hours updating code due to an external change. It was then I realized that my application had become too coupled with the database schema with the embedded SQL. I decided it would be better to move my SQL queries into stored procedures and simply call the stored procedures from my code.

I learned the following lessons from this:
  • If an application needs to execute more than a few queries it is better to have the app call a stored procedure rather than embed SQL. This way the application does not need to know any information about the database tables and can interact with a group of stored procedures that create a pseudo-interface to the database.
  • By calling the stored procedures in the code, I was able to switch to different types of databases as long as I loaded the stored procedures. I was able to quickly test my application against SQL Server Express and MySQL with no problems.
  • To make things even simpler in the code, I created constants for the stored procedures names. This allowed me to not have to keep track of the exact names of the stored procedures and gave me a central place to update stored procedure names to be used by my code.
By no means do I consider myself an expert, but I just thought I would share what I found as it made things much easier for me in the development of my app.

December 15, 2007

The Walk!!



So it is done!! I have now graduated and am deciding on my next move. There was much talk today by professors and my family about going for a Doctorate degree. I am considering it, but it will not be something I undertake in the immediate future. I need at least at least a year long break from all the school work. If I was to go back to the alma mater for the Doctorate I would have to take another 18 hours before I did two long semesters of full time study, in which I wouldn't really be able to work. Not to mention I would need to decide in what area I plan to specialize. The thesis for this time around was in Networks and I think I want to go more the software engineering route from this point forward. Oh well, it's a thought at this point at least.

For now I am in training next week for C# .NET programming. It is the first of two training courses I am taking. I need to add some more tricks to my bag and throwing a little .NET into the mix won't hurt. I'm already planning on taking the Java programmer's certification exam in the next couple of months so I can make my way to the higher Java developer certifications.

Anyway, I have done a lot of learning in the past few years and I have plans for a lot of learning in the future. I think everyone should learn as it will only expand the mind and bring about new solutions to problems.

November 28, 2007

Done the Damn Thing...
Now back to you Black Dilbert

So... I had my thesis defense on Monday afternoon. I was pretty nervous and I don't think my mouth has ever been more dry in my life. I did my best to stay calm and talk slowly, which is a bit of a struggle, and methodically make my way through my slides. I made it through them and then was able to answer all of the questions the professors asked. Then, the professors sent me out in the hallway so they could deliberate. I thought I was going to pass out while I waited the long 5 minutes while they decided, but they opened the door and all shook my hand and congratulated me on a job well done.

I took a few seconds for it to sink in, but I was finally finished with school. I am graduating!! So now I can get back to being the nice and nerdy Black Dilbert instead of poking through research papers night after night.

YAAAAAAAAAAAAAAAAAAYYYYY!!

November 25, 2007

D Day Is Coming

So Monday is the day of truth. I finally present my thesis work at 4:00pm on Monday afternoon. I'm getting a little nervous, but I think I will do well enough to get this thing completed and approved. I have my slides done, but tomorrow I will spend the day rehearsing and getting all the points I want to make down to the 'T'.

As soon as I finish this thing I am going to head right over to the bookstore to get my graduation stuff. This has been a long time coming...

November 17, 2007

SE Tip of the Day

Note: I'm going to try and start giving a SW Engineering tip that I find useful every so often. I know I'm no expert, but I'd like to think I am good at what I do.

Today's tip goes along with the maintenance phases of a project.







Tip:

When using third-party tools and libraries in your application, be sure to keep them up-to-date in your code base.
When you initially decide to use a certain version of a programming language or a third-party library package you are doing so to get the current product out the door and into use. In most cases, as soon the product is shipped newer versions of these technologies have been put into release. Often you are faced with a decision of whether to assign levels of effort to try to incorporate the new technologies with your product or to simply move forward with the status quo. I believe it would be a mistake to attempt to constantly update your code base as new versions of technologies are released. However, I believe that the discussion of upgrading to new versions of technologies should occur at least once a year. Otherwise, prolonged use of technologies that become out of date will create maintenance problems as those technologies will begin to lose the amount of support needed when having problems associated with them. So take the time to carefully upgrade your tools and libraries so your product stays with the current technologies.