lundi 17 mars 2008

Archetype's resolver

We've found that we needed a real brain storm about how we'll resolve modules URL and dependencies through configuration file.

Archetype.require is one of the oldest methods of Archetype. Many functionnalities have been added. To manage all configurations like "submodules", "needs", "aPath" and "rPath" we completed and complexified this method. It made it become a real mess and it's pretty hard to understand and maintain.

Configurations need a real recursive analysis but old require was not completely recursive (however you had to do a complex configuration to encounter any problem) and that's why we had that famous first bug on our JIRA: AJF-1.

I have extracted the resolution of modules names in the require parameter to correctly handle a recursive configuration and manage layers to order dependency loading.
Require is now really much more complete and robust and can handle any exotic configurations.

In the same evolution, I've seen that our UMN (Unique Module Name) object was used every time we needed to extract realPath or URL of the module. I transformed the $U function from returning UMN object to the URL String to simplify coding. It causes many internal refactoring but any changes for final user.

I've just committed these new functionality. It implies many changes like variables refactoring and jsdocs comment review but it's fully working.

2 commentaires:

Home Theater a dit…

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Home Theater, I hope you enjoy. The address is http://home-theater-brasil.blogspot.com. A hug.

TeMs@ a dit…

Sounds like a bot message :/