You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Vladimir Nišević <vn...@gmail.com> on 2014/10/01 09:44:50 UTC
Usage of multiple DomainObjectContainers ?
Hi guys, I have a requirement where parts of my domain objects come from
different sources.
a. reational database
b. elasticsearch (accessible thru REST interface)
What would be a feasible approach?
My first idea was to introduce a view models and instantiate them manually
and fill them from RDB and Elasticsearch sources. A kind of anticorruption
layer?
Or should I implement additional DomainObjectContainer interface (
https://isis.apache.org/reference/DomainObjectContainer.html ) for
elasticsearch?
Can I use multiple domain object container implementation at the same time?
Regs,Vladimir
Re: Usage of multiple DomainObjectContainers ?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 1 October 2014 13:46, Vladimir Nišević <vn...@gmail.com> wrote:
> Hi Dan, thanks for your feedback, I'll stick to my first idea, and as soon
> I have something to share, will definitely come back to you.
>
>
> Nevertheless, I have some show-stoppers there:
>
> 1. View model representation in wicket viewer - please check my latest
> comments on https://issues.apache.org/jira/browse/ISIS-899
Thanks for finding this; it looks like you've raised ISIS-915 for this;
thanks.
See the comments on that ticket.
> 2. View model entity referencing another view model entity - check also
> same issue
>
>
I see you've raised ISIS-914 and ISIS-915. I've closed ISIS-914 as it is,
basically, a duplicate.
>
>
> 3. Also have another question / feature request regarding restful viewer.
>
> My service consumer needs actually simplified JSON response. I guess I
> would need a kind simplified rest viewer?
>
>
Coincidentally someone else has (off-list) brought up the same requirement
with us.
What I've proposed to do is to factor out the logic in the RO viewer that
builds the JSON representation and put it behind a @DomainService. As a
first cut, I think it's only the object representation and list
representations that need to be pluggable. Ultimately I would like to get
to a point where the representation used honours the Accept header
(Content-Type), but will probably iterate to get there. I've raised
ISIS-917 for this.
This also depends on ISIS-916, to support pluggable domain services.
Cheers
Dan
> Regs,Vladimir
>
>
>
> Here my spec by example:
>
>
> *Given two view model objects and domain service returning instance of A.*
>
> @ViewModel
> Class A {
>
> private int id;
>
> private String a1;
>
> private B b1;
>
> }
>
> ....
> @ViewModel
> Class B {
>
> private int id;
> private String c1;
> }
>
> *when a 3rd party service consumer calls the domain service method
> getForExample() thru restful invoke API*
>
> @DomainService
> public class Service1 {
>
> public A getForExample() {
> ...
> }
> }
>
> *then the answer should be a simple JSON structure representing only the
> parameters of the objects*
>
> {
> id: "123",
> a1: "someTextHere",
>
> b1 : {
>
> c1: "someAnotherTextHere"
>
> }
>
> }
>
>
>
>
>
>
> 2014-10-01 9:50 GMT+02:00 Dan Haywood <da...@haywood-associates.co.uk>:
>
> > Hi Vladimir,
> >
> > I would go with your first idea; this sort of "side-loading" approach
> > should work fine.
> >
> > If you end up with anything that is reusable, please consider creating a
> > github repo so that we can (at minimum) fork it into isisaddons [1]
> >
> > Cheers
> > Dan
> >
> > [1] http://www.isisaddons.org/
> >
> >
> > On 1 October 2014 08:44, Vladimir Nišević <vn...@gmail.com> wrote:
> >
> > > Hi guys, I have a requirement where parts of my domain objects come
> from
> > > different sources.
> > >
> > > a. reational database
> > > b. elasticsearch (accessible thru REST interface)
> > >
> > > What would be a feasible approach?
> > >
> > > My first idea was to introduce a view models and instantiate them
> > manually
> > > and fill them from RDB and Elasticsearch sources. A kind of
> > anticorruption
> > > layer?
> > >
> > > Or should I implement additional DomainObjectContainer interface (
> > > https://isis.apache.org/reference/DomainObjectContainer.html ) for
> > > elasticsearch?
> > >
> > > Can I use multiple domain object container implementation at the same
> > time?
> > >
> > > Regs,Vladimir
> > >
> >
>
Re: Usage of multiple DomainObjectContainers ?
Posted by Vladimir Nišević <vn...@gmail.com>.
Hi Dan, thanks for your feedback, I'll stick to my first idea, and as soon
I have something to share, will definitely come back to you.
Nevertheless, I have some show-stoppers there:
1. View model representation in wicket viewer - please check my latest
comments on https://issues.apache.org/jira/browse/ISIS-899
2. View model entity referencing another view model entity - check also
same issue
3. Also have another question / feature request regarding restful viewer.
My service consumer needs actually simplified JSON response. I guess I
would need a kind simplified rest viewer?
Regs,Vladimir
Here my spec by example:
*Given two view model objects and domain service returning instance of A.*
@ViewModel
Class A {
private int id;
private String a1;
private B b1;
}
....
@ViewModel
Class B {
private int id;
private String c1;
}
*when a 3rd party service consumer calls the domain service method
getForExample() thru restful invoke API*
@DomainService
public class Service1 {
public A getForExample() {
...
}
}
*then the answer should be a simple JSON structure representing only the
parameters of the objects*
{
id: "123",
a1: "someTextHere",
b1 : {
c1: "someAnotherTextHere"
}
}
2014-10-01 9:50 GMT+02:00 Dan Haywood <da...@haywood-associates.co.uk>:
> Hi Vladimir,
>
> I would go with your first idea; this sort of "side-loading" approach
> should work fine.
>
> If you end up with anything that is reusable, please consider creating a
> github repo so that we can (at minimum) fork it into isisaddons [1]
>
> Cheers
> Dan
>
> [1] http://www.isisaddons.org/
>
>
> On 1 October 2014 08:44, Vladimir Nišević <vn...@gmail.com> wrote:
>
> > Hi guys, I have a requirement where parts of my domain objects come from
> > different sources.
> >
> > a. reational database
> > b. elasticsearch (accessible thru REST interface)
> >
> > What would be a feasible approach?
> >
> > My first idea was to introduce a view models and instantiate them
> manually
> > and fill them from RDB and Elasticsearch sources. A kind of
> anticorruption
> > layer?
> >
> > Or should I implement additional DomainObjectContainer interface (
> > https://isis.apache.org/reference/DomainObjectContainer.html ) for
> > elasticsearch?
> >
> > Can I use multiple domain object container implementation at the same
> time?
> >
> > Regs,Vladimir
> >
>
Re: Usage of multiple DomainObjectContainers ?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Vladimir,
I would go with your first idea; this sort of "side-loading" approach
should work fine.
If you end up with anything that is reusable, please consider creating a
github repo so that we can (at minimum) fork it into isisaddons [1]
Cheers
Dan
[1] http://www.isisaddons.org/
On 1 October 2014 08:44, Vladimir Nišević <vn...@gmail.com> wrote:
> Hi guys, I have a requirement where parts of my domain objects come from
> different sources.
>
> a. reational database
> b. elasticsearch (accessible thru REST interface)
>
> What would be a feasible approach?
>
> My first idea was to introduce a view models and instantiate them manually
> and fill them from RDB and Elasticsearch sources. A kind of anticorruption
> layer?
>
> Or should I implement additional DomainObjectContainer interface (
> https://isis.apache.org/reference/DomainObjectContainer.html ) for
> elasticsearch?
>
> Can I use multiple domain object container implementation at the same time?
>
> Regs,Vladimir
>