Vaughn Bullard

All things that keep my interest

ResourceBundles, Preferences API or JNDI references

December 20th, 2008

OK,

So I was recently on a project where deployment of the database connection information became a concern because they were in properties and loaded by a ResourceBundle. There’s no one reason I could find to use one over the other and I think at this point time, strictly a design time decision. Obviously certain things will be deprecated over time, but below I provide sort of a pros and cons for each component.

ResourceBundles
Pros:

  • lightweight file readers
  • More of use when a lot of localization must occur for one’s application – extremely useful when the programmer has more control of the application and its deployment.
  • Useful for backporting to previous JDKs
  • Programmer has a lot more control
  • Maintenance of code-drop once to the customer, provided no settings change between drops, the customer does not have to modify the properties files

Cons:

  • If deploying there tends to be issues on where the properties file can exist, how the class loader loads those files for usage in code, how the systems administrator modifies those files in case of changes, etc.
  • Properties files can become corrupted. Question becomes “How does one maintain that persistence store so it does not become corrupted?”
  • Properties files do not scale well at all.
  • Properties files are strictly name/value string pairs and provide no capability to datatype them

JNDI API
Pros:

  • Easier to develop to
  • Easier to maintain from a systems administration point of view
  • Harder for the programmer to programmatically modify the settings from the application perspective.
  • Useful for backporting applications to previous JDKs

Cons:

  • Heavyweight – very large consisting of 5 packages and 83 classes.
  • Provides no policy as to where in directory name space the preference data should be stored, or in which name space

Preferences API
Pros:

  • Back-end Neutral
  • Policy and Data Driven
  • Provides “atomic-like” updates to preferences
  • Is the API that will be used in future JDKs from 1.4 on
  • Has a backing store capability in case of failures

Cons:

  • Is not a substitute for database, for like guarantees of transactional capabilities
  • Is not backward compatible to JDKs to JDKs under 1.4 but then again if you’re using 1.4 you’ve already got one foot in the tar pit.

While it’s simply a comparison, it really boils down to how the application is controlled, deployed and maintained. There is no one way better than the other that I can see other than the potential deprecation issues of the old APIs in the future. I’d definitely be interested in seeing what other developers and architects are doing. Just because it’s old doesn’t mean it isn’t a useful or even better API.

:Vaughn

Tags: information, time, concern, loader, application, Vaughn ResourceBundles, customer, Useful, space

Why I dual-boot.

April 10th, 2006

Hmmmm,

I’ve been reading some blogs regarding that Mac users are ardently opposed to dual-booting Windows. If this was the case, why would Apple create BootCamp? These two occurences are in sharp contrast.

I, for one, love my MacBook and one would have trouble prying it from my cold, dead lifeless fingers. I will not give up the $25K in software that I’ve invested with the Mac. Just no way! My reason for dual-booting Windows and Mac is because my company does not create Mac-based binaries for their software suite. I don’t want to carry around my ThinkPad, that the company issued me, in addition to the MacBook. I also program in Java and Visual C# .NET with MS Visual Studio 2005. As a consultant, I need flexibility because not all of my customers have one type of architecture nor do they have one type of language that they program in.

So therefore, I created a partition for Windows that I use exclusively for work. It provides me more flexibility than before and made me a happier Apple customer.

So, maybe Apple knows that there are folks out there like me who need that specific flexibility. As for the Mac users who are ardently opposed to dual-booting Windows; well, they need to go back to the Tar Pits. Get used to the fact that ‘the times they are a changin”.

:Vaughn

Tags: fingers, trouble, Windows, Studio, customer, Pits

Windows XP on my MacBook Pro

April 6th, 2006

Well,

“Be careful what you wish for because you just might get it. ” – or that’s how the proverb goes. Anyway, I said I would wait until there was a commercial application before I put Windows XP on my MacBook Pro. Well, I did, Apple released BootCamp-a product that enables you to dual-boot Windows and Mac OS X on the same machine. All I can say is wow, my MacBook Pro has turned into a powerhouse work computing device; and thanks to the 256MB video card; has turned into a portable gamepad like no other. The graphics card on board the MacBook Pro is an ATI Mobility Radeon X1600 card with 256MB SDRAM. I installed a few highly-graphics-processor-intensive Windows games on there and they rocked!

So right now, I have a dual partition 100 GB on Mac OS X and 20 GB on Windows XP Pro SP2. I chose the option to have Windows XP installed on a FAT32 partition. This enables me to write to the Windows drive from Mac OS X, but not vice versa. This is OK; because most of my really good editing tools are on the Mac.

I guess it’s kind of anti-climactic to have Windows XP on my Mac, but its really cool from the perspective that I don’t have to lug around two laptops on my engagements at customer sites.

The link for BootCamp is http://www.apple.com/macosx/bootcamp

:Vaughn

Tags: lug, Video, customer, video card, commercial application, machine, application