You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by au...@telekom.de on 2014/10/10 09:48:03 UTC

Web-App with ISIS usings a (Soap) WebService (no persistence)

I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need all the persistence stuff
cause I have to call a WebService instead of that.

My idea:

-       Compile wsdl2java (using jdk wsimport now)
-       Enrich (merge in) the generated .java files with the ViewModel-methods (deriving the classes from ViewModel)
-       Build services calling the webservice

My questions:

-       Is that idea a good one or should I go some other way ?
-       Is anybody out there who did that already willing to share some experiences ?

Basically I'd like to get all of ISIS but no persistence
cause I have very deep data-structures to be shown and edited in the UI
which I don't want to build up by means of Vaadin

Any help or just little hints appreciated!
(Even "That's a stupid idea remarks" :-) )

Augustinus Deimel


Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 10 October 2014 09:37, <au...@telekom.de> wrote:

> Hi Dan,
>
> thank you very much for your ultrafast answer !
>
> Yes, your answer helps but I'm not a 100% sure to go that way just because
> of the timeframe in my project
> and that seems to be some more generic work to do and I'm just a medium
> skilled programmer.
>

For simple view models we've just introduced (in 1.7.0-SNAPSHOT) the
@ViewModel annotation.  This will automatically create a view model for any
pojo, using the property getters and setters; no interface required.  But
that might not be sophisticated enough for your requirement.



>
> But nevertheless - perhaps I'll give it a try in my evening time hopefully
> not having to fight with my wife ;-)
>
> :-)



> Best Regards,
>
> Augustinus
>
> PS:
> By the way:
> I liked to read your book on nakedobjects - not just because it describes
> this idea coding-based but even more
> cause it teaches you clear OO- and dependency avoiding thinking !
>
>
Thanks.

The techniques I described in the book were just the standard dependency
inversion techniques, a la Uncle Bob et al.

Since writing the book, we've expanded the framework itself with fully
fleshed-out contributed properties and collections (as well as regular
contributed actions), and we've also introduced the event bus.  So fully
decoupled apps are now really easy to do.





> -----Ursprüngliche Nachricht-----
> Von: Dan Haywood [mailto:dan@haywood-associates.co.uk]
> Gesendet: Freitag, 10. Oktober 2014 10:12
> An: users
> Betreff: Re: Web-App with ISIS usings a (Soap) WebService (no persistence)
>
> Hi Augustinus,
>
> ... and welcome to the Isis mailing list.
>
> This idea has come up several times in various flavours, and it's
> certainly achievable.  Indeed, Kevin (one of our committers) is prototyping
> a system for his client which is conceptually similar... it loads its data
> out of an SCM (git or similar, I guess).
>
> David Tildesley, whose been working on a system down in NZ for a while,
> has also talked about something similar.
>
> And over in Ireland where I consult on the "sister" .NET system (running
> on Naked Objects MVC), we've used a variation of this architecture to
> bridge from a legacy client/server system to a new system based on NO MVC,
> where new functionality is built "natively" and existing functionality from
> the legacy system is exposed by wrapping each legacy entity as a view model.
>  (The variation is that the back-end of the legacy system runs in the same
> process space as the new system).
>
> The main issue you'll face is in constructing the mementos of the view
> models.  Currently the MementoService can only handle primitives and
> entities; in other words it isn't possible for a view model to reference
> another view model.  This might be an issue for you if you have a deep
> hierarchy/complex structure.  We've raised a ticket for this, but right now
> [1], but for the moment you're on your own to figure out a way to handle
> this.
>
> The other thing to be aware of is that, if you want your view models to be
> editable, then they need to implement the ViewModel.Cloneable
> subinterface.  That's because view models are immutable.
>
> And one final thing: there is a practical limit of 2083 chars for URLs,
> which impacts the length of a memento string.  The work-around is to have
> the memento refer to a GUID and store the state in an HttpSession or a
> distributed cache (if using the RO viewer).
>
> Hope that helps,
>
> Cheers
> Dan
>
>
>
> [1] https://issues.apache.org/jira/browse/ISIS-915
>
>
> On 10 October 2014 08:48, <au...@telekom.de> wrote:
>
> > I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need
> > all the persistence stuff cause I have to call a WebService instead of
> > that.
> >
> > My idea:
> >
> > -       Compile wsdl2java (using jdk wsimport now)
> > -       Enrich (merge in) the generated .java files with the
> > ViewModel-methods (deriving the classes from ViewModel)
> > -       Build services calling the webservice
> >
> > My questions:
> >
> > -       Is that idea a good one or should I go some other way ?
> > -       Is anybody out there who did that already willing to share some
> > experiences ?
> >
> > Basically I'd like to get all of ISIS but no persistence cause I have
> > very deep data-structures to be shown and edited in the UI which I
> > don't want to build up by means of Vaadin
> >
> > Any help or just little hints appreciated!
> > (Even "That's a stupid idea remarks" :-) )
> >
> > Augustinus Deimel
> >
> >
>

AW: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by au...@telekom.de.
Hi Dan,

thank you very much for your ultrafast answer !

Yes, your answer helps but I'm not a 100% sure to go that way just because of the timeframe in my project
and that seems to be some more generic work to do and I'm just a medium skilled programmer.

But nevertheless - perhaps I'll give it a try in my evening time hopefully not having to fight with my wife ;-)

Best Regards,

Augustinus

PS:
By the way: 
I liked to read your book on nakedobjects - not just because it describes this idea coding-based but even more
cause it teaches you clear OO- and dependency avoiding thinking !

-----Ursprüngliche Nachricht-----
Von: Dan Haywood [mailto:dan@haywood-associates.co.uk] 
Gesendet: Freitag, 10. Oktober 2014 10:12
An: users
Betreff: Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Hi Augustinus,

... and welcome to the Isis mailing list.

This idea has come up several times in various flavours, and it's certainly achievable.  Indeed, Kevin (one of our committers) is prototyping a system for his client which is conceptually similar... it loads its data out of an SCM (git or similar, I guess).

David Tildesley, whose been working on a system down in NZ for a while, has also talked about something similar.

And over in Ireland where I consult on the "sister" .NET system (running on Naked Objects MVC), we've used a variation of this architecture to bridge from a legacy client/server system to a new system based on NO MVC, where new functionality is built "natively" and existing functionality from the legacy system is exposed by wrapping each legacy entity as a view model.
 (The variation is that the back-end of the legacy system runs in the same process space as the new system).

The main issue you'll face is in constructing the mementos of the view models.  Currently the MementoService can only handle primitives and entities; in other words it isn't possible for a view model to reference another view model.  This might be an issue for you if you have a deep hierarchy/complex structure.  We've raised a ticket for this, but right now [1], but for the moment you're on your own to figure out a way to handle this.

The other thing to be aware of is that, if you want your view models to be editable, then they need to implement the ViewModel.Cloneable subinterface.  That's because view models are immutable.

And one final thing: there is a practical limit of 2083 chars for URLs, which impacts the length of a memento string.  The work-around is to have the memento refer to a GUID and store the state in an HttpSession or a distributed cache (if using the RO viewer).

Hope that helps,

Cheers
Dan



[1] https://issues.apache.org/jira/browse/ISIS-915


On 10 October 2014 08:48, <au...@telekom.de> wrote:

> I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need 
> all the persistence stuff cause I have to call a WebService instead of 
> that.
>
> My idea:
>
> -       Compile wsdl2java (using jdk wsimport now)
> -       Enrich (merge in) the generated .java files with the
> ViewModel-methods (deriving the classes from ViewModel)
> -       Build services calling the webservice
>
> My questions:
>
> -       Is that idea a good one or should I go some other way ?
> -       Is anybody out there who did that already willing to share some
> experiences ?
>
> Basically I'd like to get all of ISIS but no persistence cause I have 
> very deep data-structures to be shown and edited in the UI which I 
> don't want to build up by means of Vaadin
>
> Any help or just little hints appreciated!
> (Even "That's a stupid idea remarks" :-) )
>
> Augustinus Deimel
>
>

Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Augustinus,

... and welcome to the Isis mailing list.

This idea has come up several times in various flavours, and it's certainly
achievable.  Indeed, Kevin (one of our committers) is prototyping a system
for his client which is conceptually similar... it loads its data out of an
SCM (git or similar, I guess).

David Tildesley, whose been working on a system down in NZ for a while, has
also talked about something similar.

And over in Ireland where I consult on the "sister" .NET system (running on
Naked Objects MVC), we've used a variation of this architecture to bridge
from a legacy client/server system to a new system based on NO MVC, where
new functionality is built "natively" and existing functionality from the
legacy system is exposed by wrapping each legacy entity as a view model.
 (The variation is that the back-end of the legacy system runs in the same
process space as the new system).

The main issue you'll face is in constructing the mementos of the view
models.  Currently the MementoService can only handle primitives and
entities; in other words it isn't possible for a view model to reference
another view model.  This might be an issue for you if you have a deep
hierarchy/complex structure.  We've raised a ticket for this, but right now
[1], but for the moment you're on your own to figure out a way to handle
this.

The other thing to be aware of is that, if you want your view models to be
editable, then they need to implement the ViewModel.Cloneable
subinterface.  That's because view models are immutable.

And one final thing: there is a practical limit of 2083 chars for URLs,
which impacts the length of a memento string.  The work-around is to have
the memento refer to a GUID and store the state in an HttpSession or a
distributed cache (if using the RO viewer).

Hope that helps,

Cheers
Dan



[1] https://issues.apache.org/jira/browse/ISIS-915


On 10 October 2014 08:48, <au...@telekom.de> wrote:

> I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need all
> the persistence stuff
> cause I have to call a WebService instead of that.
>
> My idea:
>
> -       Compile wsdl2java (using jdk wsimport now)
> -       Enrich (merge in) the generated .java files with the
> ViewModel-methods (deriving the classes from ViewModel)
> -       Build services calling the webservice
>
> My questions:
>
> -       Is that idea a good one or should I go some other way ?
> -       Is anybody out there who did that already willing to share some
> experiences ?
>
> Basically I'd like to get all of ISIS but no persistence
> cause I have very deep data-structures to be shown and edited in the UI
> which I don't want to build up by means of Vaadin
>
> Any help or just little hints appreciated!
> (Even "That's a stupid idea remarks" :-) )
>
> Augustinus Deimel
>
>

Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by David Tildesley <da...@yahoo.co.nz>.
Hi Dan, Ged,

No, unfortunately this wasn't pursued. However we did go down the view object track for a simple backend ws integration. 
Augustinus has touched on the same issue - ISIS domain should be capable of having non-locally persisted domain  objects that can save or have data injected via DI via a system integration layer.

Regards,
David.
Sent from Yahoo Mail on Android


Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Ged,

Good point.   In fact, this is the approach that Kevin and I were
discussing too for his requirement.  We both quite liked the idea that Isis
acts as a "scratchpad" for such edits.  If those objects are not deleted
from Isis afterwards, it could also act as an audit trail of such edits.

I think that David T. also came up with a similar idea (I don't know if he
implemented anything with it).

Cheers
Dan


On 10 October 2014 10:11, Ged Byrne <ge...@gmail.com> wrote:

> Hi Augustinus,
>
> Have you considered using Isis using a lightweight data store.
>
> For example, configuring the JDO Objectstore to use an in-memory HSQLDB
> connection just like the ToDo Archetype[1].
>
> You could then create services that makes the calls to your webservices to
> read data into and send updates from your database.
>
> You can do this two ways:
>
> 1.  Have explicit load and save operations.
> 2,  Hook into the life cycle call backs [2]
>
> This approach is particularly useful when you have complex objects that you
> want to allow the user to build up before committing them to the web
> services.
>
> Regards,
>
>
>
> Ged
>
> [1] http://isis.apache.org/intro/getting-started/todoapp-archetype.html
> [2] http://isis.apache.org/reference/object-lifecycle-callbacks.html
>
>
>
> On 10 October 2014 08:48, <au...@telekom.de> wrote:
>
> > I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need all
> > the persistence stuff
> > cause I have to call a WebService instead of that.
> >
> > My idea:
> >
> > -       Compile wsdl2java (using jdk wsimport now)
> > -       Enrich (merge in) the generated .java files with the
> > ViewModel-methods (deriving the classes from ViewModel)
> > -       Build services calling the webservice
> >
> > My questions:
> >
> > -       Is that idea a good one or should I go some other way ?
> > -       Is anybody out there who did that already willing to share some
> > experiences ?
> >
> > Basically I'd like to get all of ISIS but no persistence
> > cause I have very deep data-structures to be shown and edited in the UI
> > which I don't want to build up by means of Vaadin
> >
> > Any help or just little hints appreciated!
> > (Even "That's a stupid idea remarks" :-) )
> >
> > Augustinus Deimel
> >
> >
>

Re: Web-App with ISIS usings a (Soap) WebService (no persistence)

Posted by Ged Byrne <ge...@gmail.com>.
Hi Augustinus,

Have you considered using Isis using a lightweight data store.

For example, configuring the JDO Objectstore to use an in-memory HSQLDB
connection just like the ToDo Archetype[1].

You could then create services that makes the calls to your webservices to
read data into and send updates from your database.

You can do this two ways:

1.  Have explicit load and save operations.
2,  Hook into the life cycle call backs [2]

This approach is particularly useful when you have complex objects that you
want to allow the user to build up before committing them to the web
services.

Regards,



Ged

[1] http://isis.apache.org/intro/getting-started/todoapp-archetype.html
[2] http://isis.apache.org/reference/object-lifecycle-callbacks.html



On 10 October 2014 08:48, <au...@telekom.de> wrote:

> I'd like to use ISIS for my Web-App (.war / Tomcat) but I don't need all
> the persistence stuff
> cause I have to call a WebService instead of that.
>
> My idea:
>
> -       Compile wsdl2java (using jdk wsimport now)
> -       Enrich (merge in) the generated .java files with the
> ViewModel-methods (deriving the classes from ViewModel)
> -       Build services calling the webservice
>
> My questions:
>
> -       Is that idea a good one or should I go some other way ?
> -       Is anybody out there who did that already willing to share some
> experiences ?
>
> Basically I'd like to get all of ISIS but no persistence
> cause I have very deep data-structures to be shown and edited in the UI
> which I don't want to build up by means of Vaadin
>
> Any help or just little hints appreciated!
> (Even "That's a stupid idea remarks" :-) )
>
> Augustinus Deimel
>
>