Hello,

I am finishing the implementation of the extension, but I have reached a
point where I must make an important decision about the structure of the
data model in order to finish.
For the implementation with morphia-mongodb it is necessary that the
relationship between the different models be made by classes, storing an
object within another object to which the relation refers, instead of only
storing the id of the other entity.
This means, in case I have not explained myself well, for example:

Person:
id,
first name,
etc

Cat:
id,
first name,
Owner (Person)

Having these two tables, in the Cat class an object of the type Person
would be stored, instead of a simple field that refers to the id of the
Person.

With this clear, I am in the situation where original implementation is
based on relationships through a simple field that refers to the id of the
other table, but the implementation for morphia is based on the
relationship with objects.
To finish the common extension, I need to modify this in such a way that
both parties can continue working without altering a large part of the
project.
My proposals are:
1 - Use for all cases the relation by means of objects, since the relation
by means of id is not compatible with both cases.
This is the simplest option and it can give less problems.
It would no longer be necessary to recover the relationships, by means of
the id since you always have the data of the related object.
The only drawback would be to include more information than necessary in
some cases.

2 - Create several interfaces that inherit from the same base, in which
each inheritance on said interface adds the necessary methods.
This option is more complex, since it requires a deeper analysis to
abstract each model with a customized interface for each case.
It must also overwrite the basic methods to get the id inside the object,
so that the rest of the project keeps calling its methods.
The project should have many interfaces to implement the necessary methods
that do not exist in the main interfaces.
In addition it is very likely that castings must be added to the interfaces
controlling at all times what type of extension is being worked on.

I think I have explained it more or less well, it is possible that my
expression in the language is not the most appropriate since I do not speak
English well.

I hope you respond with ideas and proposals, as well as your opinion on
what I am trying to solve.
If you need to see the code, I can share it without problem, even if it is
not completely finished.

A greeting.

El mié., 28 nov. 2018 a las 1:56, Nick Couchman (<[email protected]>)
escribió:

> On Mon, Nov 26, 2018 at 5:59 PM Daniel Quirant Rico <
> [email protected]> wrote:
>
> > Hello,
> >
> > I have been absent for a while and I am going to resume this project.
> > I would like to know if any progress has been made in this regard and
> > I need to document beforehand.
> > The Jira were GUACAMOLE-605 and GUACAMOLE-617.
> > I hope to be active soon and continue with this great project.
> >
> >
> I haven't personally worked on these, and have not seen anything from
> anyone else indicating progress on these, so I think it's all up to you!
>
> :-D
>
> -Nick
>

Reply via email to