Story Serialisation/Deserialisation

6 views
Skip to first unread message

Cyrill Rüttimann

unread,
Oct 28, 2009, 2:17:08 PM10/28/09
to easyb...@googlegroups.com
Hello,

I like to serialise/deserialise storie files to java beans and vice
versa. Maybe I can find this code already in the easyb source code?
Any pointer to a class (groovy or java) is much appreciated.


Regards,

Cyrill

Andy

unread,
Nov 2, 2009, 4:39:17 PM11/2/09
to Easyb Users
I'm not sure I follow you -- stories and specs are actually just
groovy scripts; we do, however, represent them as domain objects
(namely Story and Specification) which you can find here:
http://code.google.com/p/easyb/source/browse/#svn/trunk/easyb/src/java/org/easyb/domain

You can serialize these objects.

Cyrill Rüttimann

unread,
Nov 4, 2009, 12:53:54 AM11/4/09
to easyb...@googlegroups.com
Hello,

OK, the question lacked some fundamental details. I am asking this
question because of the synchronisation I want to implement.

1) I get new stories from the repository and write the groovy scripts
- no problem
2) Some stories are missing in the repository but are available
locally, delete them - no problem
3) Stories have changed in the repository - problem!

Based on the syntax of a story (groovy script), I belief that it's not
an easy task. Parsing the script, updating/delete/add the elements of
the story and do not touch the "glue" the developer has put into the
closures. So I came up it whould be the easier If I am able to read
the story and translate it to domain objects (deserialise), update the
domain objects and then serialise them again to groovy scripts. The
code to deserialise is available in easyb, but not to serialise. I am
not aware of such a framework which supports this requirement. I know
Smooks which supports every type of structured file for
deserialisation, but not for serialisation.

I hope I have described my problem a bit better and maybe someone
comes up with a better idea than mine. Maybe It's not that hard to add
the serialisation code to the existing easyb codebase - I am not a
regular groovy user and do not know it.


Regards,

Cyrill

Andy

unread,
Nov 6, 2009, 10:31:31 AM11/6/09
to Easyb Users
inline...
On Nov 4, 12:53 am, Cyrill Rüttimann <ruetti...@me.com> wrote:
> Hello,
>
> OK, the question lacked some fundamental details. I am asking this  
> question because of the synchronisation I want to implement.
>
> 1) I get new stories from the repository and write the groovy scripts  
> - no problem
> 2) Some stories are missing in the repository but are available  
> locally, delete them - no problem
> 3) Stories have changed in the repository - problem!

Very interesting! I have a better idea of what you are doing now!

>
> Based on the syntax of a story (groovy script), I belief that it's not  
> an easy task. Parsing the script, updating/delete/add the elements of  
> the story and do not touch the "glue" the developer has put into the  
> closures. So I came up it whould be the easier If I am able to read  
> the story and translate it to domain objects (deserialise), update the  
> domain objects and then serialise them again to groovy scripts. The  
> code to deserialise is available in easyb, but not to serialise. I am  
> not aware of such a framework which supports this requirement. I know  
> Smooks which supports every type of structured file for  
> deserialisation, but not for serialisation.
>
> I hope I have described my problem a bit better and maybe someone  
> comes up with a better idea than mine. Maybe It's not that hard to add  
> the serialisation code to the existing easyb codebase - I am not a  
> regular groovy user and do not know it.

I wasn't aware of Smooks before, but I think it is inline with what
you are looking for -- from what I gather, you'd like to be able to
represent a story via some domain object that also embodies the
developer code (or glue as you've called it) -- you'd like to update
the text associated with a step, for example, but not alter the code.

I'll look into Smooks a bit more, but it seems that's a good direction
other than coding it yourself -- luckily, the "grammar" of an easyb
story is simple enough and hierarchical so there are a few ways to
make this job easier I would think.

>
> Regards,
>
> Cyrill
>
> On 02.11.2009, at 22:39, Andy wrote:
>
>
>
> > I'm not sure I follow you -- stories and specs are actually just
> > groovy scripts; we do, however, represent them as domain objects
> > (namely Story and Specification) which you can find here:
> >http://code.google.com/p/easyb/source/browse/#svn/trunk/easyb/src/jav...
Reply all
Reply to author
Forward
0 new messages