Vita Rara: A Life Uncommon

Mark's blog

What's Wrong with Java's Dynamic Dispatch or "How I Implemented sendMessage()"


Categories:

(Related article using this technique to "script" some Java objects: article.)

The following code quickly illustrates an issue with the Reflection API's in the Java language. At run time finding methods on classes requires that the types passed to Class#findMethod() exactly match those found in the method declaration. The JavaDoc and language spec refers to these as the "formal parameter types".

The issue is, I have a method that takes an A, and I have an object of B that extends A. If you run the following code it will fail, being unable to find the method.

Closures and Bindings in Groovy


Categories: |

You can learn something every day. That's what is so nice about being a software developer.

Today I was looking at some Grails code, seeing how some of the metaprogramming features of Groovy are used in the framework. After poking around I decided to look at the ServicesGrailsPlugin to see how the automatic wiring of services was done, and ran across the following code:

def doWithSpring = {
  application.serviceClasses.each { serviceClass ->
      def scope = serviceClass.getPropertyValue("scope")

    "${serviceClass.fullName}ServiceClass"(MethodInvokingFactoryBean) {
      targetObject = ref("grailsApplication", true)

Yes the JVM is a Multi-Language Platform


Categories: |

Although talk about multiple languages running on the JVM has grown over the past few years, the reality of it really hit home with me this morning. I turned to one of my employees who has been doing JVM development for me since April of last year. The interesting thing is probably 95% of the JVM work he has done isn't in Java, it's in Groovy. Here's to the multi-language Java platform and a thank you to those developers who are making it a reality.

Ruby Metaprogramming: Declaratively Adding Methods to a Class


Categories: |

In this brief piece I will examine Ruby's support for metaprogramming and how to define class level methods that add instance methods to our class implementations at run time.

Over the past few months I've been learning Ruby on Rails. One of the most attractive features of Rails its declarative style of defining relationships and validations on models; and filters on actions.

A simple example of this declarative style:

class Party < ActiveRecord::Base
  has_many :addresses
end

This class defines a Party model that can have many addresses. The simple "has_many :addresses" declaration is a great example of the power of Ruby. This simple statement adds a number of methods to our Party class, and allows us to easily manage relationships between our parties and their addresses.

Setup (RESTful) Authentication First


Categories:

Well, I've learned a lesson, so learn from me, and don't repeat it. If you're going to use either of the Rails authentication plugins (restful_authentication or acts_as_authenticated), just set them up first, before you start into your own user models, etc. It's much easier that way.

Thank You Zed


Categories:

Dear Zed,

About that long Ruby on Rails rant against its core developers, the Rails community, those of us coming late to the party from other languages and platforms, and just about everyone else in sight... ok, credit where credit is due, Obie Fernandez and Mingle came in for some praise. Anyway, I won't hash it all out again. I really don't care. I will say though I strongly disagree with how you went about it. Bile is bile, and what you wrote is bile. I'm reasonably qualified in the taxonomy of Internet writing to make the identification. (Yes, I've written my share of flames, but none quite so base as yours.)

How I Use Rails Migrations for a New Project


Categories:

Yesterday I started a new Rails project and it got me thinking about how I use migrations at the start of a project. I generally start with models and migrations when I begin a new project.

My usage of migrations tends to differ in the first day(s) of a Rails project. I will frequently roll the version of the data schema between 0 and the current version. I do this because if I forget a field/property on a model I don't define a new migration to add it, I just roll the schema back to 0 (rake db:migrate VERSION=0), change the create table migration, and then do a rake db:migrate to bring the schema right up to date. I find this the most pragmatic method early on and I continue to use it until I can't.

The Future That Has Already Happened


Categories: | | | | | |

January second's Daily Drucker dealt with the future, but not as most business prognosticators or futurists might. As Drucker states it, "The important thing is to identify the 'future that has already happened...'"

The action point for the day is to identifying those trends in our market that have already happened, write about their longevity and their effect on our life and organization.

Software as a Service For the Rest of Us

Over the past few years, and particularly in 2007 Software as a Service (Saas) has really broken out and has become a force in the software industry. The first large scale SaaS offering that really broke through to my consciousness was Salesforce.com, then for me came Basecamp from 37signals.com. Salesforce.com represented a high level enterprise offering, with a high level of complexity and expense. Basecamp brought software as a service home to us all.

The Daily Drucker


Categories: |

For the Holidays I picked up a copy of "The Daily Drucker" (Barnes and Noble, Amazon.com), a daily reader with short excepts from the great corpus of Peter Drucker's life long writing.

For those who have read widely of Drucker's work "The Daily Drucker" would likely be a nice reminder of the high points of his management philosophy. For those coming to Drucker for the first time it will serve as a good introduction.

2007: A Retrospective


Categories: | | | | |

Personal Life

Sylva and I got married on April 28. It's been a real whirl wind since then. We are expecting our first child on April 1, 2008. My time with Sylva is special and precious. I have a great partner, and look forward to raising a family together.

Overall business issues have dominated this year. I doubt that will be that case next year.

Business

It was a hard business year, but prospects for the future look good.

Quadran

Quadran has arrived. About 63,000 lines of Groovy, Java and JSP, with some XML files to wire it all together, and it's up and running. We turned on our first Quadran installation on December 5, 2007. This was the culmination of a process that began with an initial meeting in September of 2004, and the consummation of the development agreement in July of 2006.

Syndicate content