A first take on Spicefactory projects Pimento and Parsley
I’ve been meaning to take a look at the projects from the Spicefactory guys for quite a while after hearing Borre Wessel give a talk at Skills Matter a year or so ago about the Matrix project he’d worked on.
I’d been putting this off for couple of reasons really:
- I’d got to grips with the likes of Cairngorm/PureMVC by reading Chris Giametta’s APress Pro Flex on Spring book. But it didn’t quite give me a good enough understanding how some of the XML configuration would work for a basic Java project using BlazeDS – which I finally mastered this past week or so after reading Filippo di Pisa’s APress Beginning Java and Flex book. I figured it would be prudent to have a good understanding of the basics before moving on to Spicefactory’s wares.
See my Amazon reviews here: - The fact you can’t print the documentation off, and you have to sift through a tons of it whilst glued to the web browser which took me the best part of a couple of days solid reading.
I much prefer to print stuff off and pencil notes against a hard copy…
In summary Spicefactory has four projects:
Spicelib
This is a foundational project for Parsley that provides:
- enhanced Flex reflection capabilities
- a bi-directional XML to AS3 object class mapper.(I wasn’t sure if there was a pluggable implementation here and how scalable it was. I.e. a event driven streaming affair a la SAX or a load the whole thing into memory).
It didn’t grab me as having the same elegance you find with Groovy XML builders. (XMLParser/XMLSlurper). (Scott Davis’s Groovy Recipes book rocks on this subject). - An expressions parser a la JSP EL/Velocity/Freemarker/Groovy GStrings etc. (which seemed to have a missing swc in download)
- Logging capabilities (a la Commons logging for AS3)
- A task framework. I really though this was a great idea, enabling you to abstract away fine grained events into a a higher level unit of work.
Parsley
A Flex DI framework. It sounds similar to RobotLegs, but my take it’s a bit more extensible and consequently a bit more of a learning curve. (Think Spring/Google Guice for the Flex world). The framework makes extensive use of metatags that works in either a Flash or Flex world. (Things like [Inject]) – similar to annotations in the Java world.
There’s a few strokes of genius in that the project, although I was a bit surprised none of the examples made use of the newer Vector class and still used Arrays:
- It uses a DSL builder, somewhat reminiscent of jQuery, so that configuration/wiring of components can be done with XML, AS3 or MXML that builds upon the DSL under the covers.
- The messaging infrastructure does away with the nasty constants and lots if type casting you see in the likes of Cairngorm and instead uses metatags for the publication/subscription process for events which is very clean. You can also scope the level at which you listen for events which is useful when dealing with nested visual components (Think filtered bubbling).
If you want to see a sample project, Christophe Coenraet has a handy blog post here.
Unfortunately, he didn’t go the extra mile and demonstrate integration with Pimento too.
Watch this space. I’m going to have a crack at modifying the project to do just that.
Cinammon Remoting
Jens Halm points out that the regular RemoteObject MXML tag is not type safe and you normally have to write a business delegate wrapper. Consequently in essence, this is the nut this project cracks.
Pimento
There’s some definite pluses to this project, but it has some peculiarities to it as well.
In essence it provides JPA/Hibernate/Flex/Spring integration and solves a lot of the complex issues with like lazy loading. It does this by embellishing the Java domain classes with annotations and effectively provides client-side caching. You can tweak the properties that get sent across the wire via AMF too, by doing things like making things read-only on the AS3 side, or using a @Hidden annotation.
It did seem awkward however to use interceptors to provide constrain functionality (See section 2.6 of documentation). I’d much prefer to have seen something along the lines of utilising annotations (as you see in the JSR303 Bean Validation framework/Hibernate Validator) (see Willie Wheeler’s blog post for an example). Or even better from my perspective integration with GORM.
It would be good if the project could create the appropriate MXML components for things like emails, dates etc too from annotations/data types/constraints etc.
If I can get my head around elegantly creating an example that uses Pimento and Parsley, I’ll have a crack at creating some Grails plug-ins.
Integration testing makes use of DBUnit server-side and Fluint client-side (which facilitates asynchronous operations).
I think there are some better options that have surfaced server-side than DBUnit, that I’ve seen in the Grails community. (but I’m wracking my memory to remember them as I write this… Will post back later).
The project bears a slight bit resemblance to Struts 2 in a couple of ways, in that it uses interceptors and Freemarker templates to convert Java domain classes into ActionScript. These get invoked by running Ant tasks. Felippo’s book also mentioned you can achieve similar results via UML tooling too with the likes of Visual Paradigm. (UML to Java and ActionScript 3).
You can also do things like have a named query in your Hibernate class and call into it from the Actionscript side. (Although I’m not sure if this is a potential security hole. Can you obfuscate your SWCs to avoid this?)
About this entry
You’re currently reading “A first take on Spicefactory projects Pimento and Parsley,” an entry on All things Grails and RIA
- Published:
- Thursday, October 7, 2010 / 11:06 am
- Category:
- Flex, GORM, Hibernate, ORM, Spring Framework
- Tags:
- ActionScript, AS3, Cinammon, DBUnit, Dependency Injection, DI, Flex, Fluint, Hibernate, JPA, JSR303, lazy-loading, Matrix, Parsley, Pimento, Spicefactory, Spicelib, Spring, Spring Framework
… And They Shall Know Me By My Speling Errors.
.: Blog.FlashGen.Com :: Mike Jones – Flash Platform Consultant :.
0xCAFEBABE Java Blog
:jasonrudolph => :blog
A Developer's Journal: grails
act:ualise | technology
Ad-Hockery: Gratuitous assumptions… which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]
Agile Developer Venkat's Blog
All the Way to the Beginning Are you ready? Let's get started.
An Army of Solipsists
Ayone Blog
BeauScott.com AJAX, Flex and other RIA
Bill Gloff : Citytech
bit.fusion} my binary bits and pieces.
BlackBoxWhere technology and art disappear
Building Blocks – The Adventures of Joel Hooks and His Faithful Friend Code
Can’t see nothing but the source code
Carl Sziebertis a software engineer with an interest in Spring, Hibernate, Red5 and jQuery development.
Carol McDonald's blog | Java.net
Christophe Coenraets
Christophe Herreman
CK'S Blog about anything interests me…
Code adept: Random thoughts on Agile development and other things geeky.
Code Slinger | A DP Blog
Coding and More
Colin Harrington – Technologist, Consultant, Software Engineer, Entrepreneur and Musician
dahernan : This is a Unit Test
danlynn.com – Finding adventure in just about everything
def groovy : A mostly Groovy related blog
Delahuntyware: Software engineer by day, web ideas maniac by night.
Doug McCune – Data Visualization Engineer: I was Web 2.0 before your grandma was Web 2.0
Duncan Sommerville – Developer Thoughts
Dustin's Software Development Cogitations and Speculations
Enfranchised Mind | programming, politics, & other religious issues
Epseelon IT
Flex | Xebia Blog
FlexMonkey
Foxgem's Groovy Notebook
Getting Groovy (and Grails)
Glen Smith
Graeme Rocher's Blog
Grails « Matthias Bohlen
grails blog just one piece of the open source puzzle
Grails GeekGrails tips I wanna share with you ;)
Grails Inside: Grails, Groovy and related technologies.
grailsbubbles
Grey-Bearded Geek : Random Thoughts Of A Middle-Aged Software Engineer
Groovy Grails and Webby Things
Hamlet D'Arcy : Behind the times
http://msimtiyaz.wordpress.com/
i-grails A blog about the things I work with: IBM i (or i5/OS, OS/400, System i, i5, iSeries, AS/400) and grails.
InformIT: Steven Haines
IntelliGrape Blog
Ironic Programmer
James Williams' Blog
Java Architecture Rambings
Jeffry Houser's Blog
Jeffs Groovy Web Log
Jim Shingler's thoughts about Java, Grails, Groovy, Eclipse RCP, and life in general
John Ferguson Smart : Wakaleo Consulting
John's Blog: I'll start and see what happens…
Josh Long : Code Coffee
Joy of Groovy
Judd Solutions
Ken's Technical Thoughts
Kickin' down the cobblestones
LD. Music, software, life… and stuff.
Lean Java Engineering
Liars Poker
Lucas Teixeira: My own tech words
Marcel Overdijk's Blog
Mark Palmer
Matt Woodward's posterous
Matthew Taylor
Messages from mrhaki
Michael Kimsal, web technology expert, JavaScript, PHP, AIR, Grails, Groovy, senior web architect
Mike Hugo : Piragua Consulting
MJWall.com
moongrails : def blog = {println "all about grails"}
New York Java Consultant : Java, REST, Consulting & the fun of programming
Ola Bildtsen
On Technology and Tea « Matthew Morten
organic thoughts : seemingly random and unorganized bits of information
Our Craft : Making it better
Paul Bakkar
PETER LEDBROOK : A search for meaning in software and life
R Blank Los Angeles Technologist, Entrepreneur, Educator and Community Leader
Raible Designs | Matt Raible's discussions on Java and Web Development
refactr blog on software development, design, agile processes, and business
Ryan's blog on Adobe Flex, web technology, and other miscellanea
Scott Davis
Scott Ryan's Blog
Shawn Hartsock: Thoughts & ideas
Silvio Wangler's Blog : Impressions, notes and stories about software, icehockey
smallwig : Personal ramblings of Kevin Bourrillion, senior software engineer at Google, Inc.
Space of Flex/AIR technologies
Srinivas Guthula's Blog
STATE YOUR BIZNESS : Energized Work
Steamtrain to Hyperspace : The technical blog of Daniel Honig
Steve Dalton's blog | Refactor
Stuff I’ve learned recently…
Sven Haiges, exposed
Sven Lange: A web geek's blog
techno.blog("Dion")
Ted Naleid
The MetaSieve Blog
thejavajar : java, groovy, flex, python, ruby
There Can Be Only One : Blue Train Software
Thom Nichols blog
Tomás Lin’s Programming Brain Dump
Transentia pty. ltd.; development, consulting, training at the leading-edge of technology
Václav Pech Weblog
Zorched / One Line Fix Musings of a software developer in Milwaukee, WI.
1 Comment
Jump to comment form | comment rss [?] | trackback uri [?]