Metro 0.3.2 Released

Metro , Inheritance , ColdFusion Add comments

I revisited the Metro ServiceFactory after John Whish's recent question about how Metro instantiates concrete classes. After a bit of trial and error, I'm happy to announce that the ServiceFactory now supports the creation of concrete gateways without requiring a concrete service in the same package. Before I outline how Metro resolves the class path for instantiating a Service and composed Gateways, I'll describe the basic conventions one must follow to use Metro.

  • Transfer Object definitions should be placed within a <package /> tag, so that the object class name follows the pattern {packageName}.{objectName}.
  • Any concrete Service or Gateway you write must reside within a directory whose name matches the Transfer package name.
  • Directories containing packages of concrete classes must reside directly below the root component path (the componentPath constructor argument for the ServiceFactory) or the optional library component path (the libPath constructor argument for the ServiceFactory).

Given the above requirements, the ServiceFactory will instantiate components in the following order.

  1. A Service and/or Gateway(s) found within the relative path "/{componentPath}/{packageName}".
  2. A Service and/or Gateway(s) found within the relative path "/{libPath}/{packageName}".
  3. A Service and/or Gateway(s) found within the relative path "/metro/{packageName}".
  4. The Service and Gateway found in "/metro/core".

Additionally, concrete components can extend either the core components (metro.core.Service and metro.core.Gateway), or any other component that extends the core components within the inheritance chain. This opens the door for a developer to create their own supertype components that extend the Metro core components, which are then extended by concrete components within their application. To facilitate extending the core components (or Metro packages), I have added an optional "libPath" constructor argument to the ServiceFactory.


5 responses to “Metro 0.3.2 Released”

  1. John Whish Says:
    Hi Paul, I've got another possible enhancement for you :)

    Metro's FileSystem.pathExists() method looks at the physical file system so you can't use a mapped directory for the {componentPath}. It would be really cool if you could. Sorry to be a pain and thanks for the great work you've done!
  2. John Whish Says:
    Sorry, just realised that I can set the ${key} property in the ColdSpring config for the ServiceFactory bean componentPath constructor arg, which solves the problem.
  3. Paul Marcotte Says:
    Hi John,

    Glad you found a solution. :)

    Out of curiosity, are you using application level mappings?

    Cheers,

    Paul
  4. John Whish Says:
    Hi Paul, Yes, I'm using Application level mappings.
  5. UGG Says:
    <p><a href="http://www.uggbootsretails.com"; target="_blank">UGG Argyle Knit</a> features genuine twin-face sheepskin for refreshing comfort. It's one of our tallest boots and looks great all the way up or cuffed down. <a href="http://www.uggbootsretails.com"; target="_blank">UGG boots</a> in our Classic Collection feature a soft foam insole covered with genuine sheepskin and have a molded EVA light such as <a href="http://www.uggbootsretails.com"; target="_blank">UGG Sundance</a> and <a href="http://www.uggbootsretails.com"; target="_blank">UGG Bailey Button</a>, the flexible outsole designed for amazing comfort with every step. Beat the chill in superior style with the <a href="http://www.uggbootsretails.com"; target="_blank">UGG Ultra Tall</a>. The <a href="http://www.uggbootsretails.com"; target="_blank">Bailey Button 1873</a> of light and flexible outsole along with a suede heel guard provides durable wear all season long. Detailed with three oversized wood buttons, this style can be styled up and buttoned, slouched and slightly unbuttoned, or completely cuffed. <a href="http://www.uggbootsretails.com"; target="_blank">UGG Ultra Short</a> is also a good choice for people to refuge from the cold.Just buy one of the ugg boots for your family and yourself, it’s really a good gift both for you famlily and you.Action is better than thinking in heart.</p>

Leave a Reply



Powered by Mango Blog. Design and Icons by N.Design Studio