Skip to content

Update entire Bean #66

@ASchmidt84

Description

@ASchmidt84

Hi,
I have a client/server architecture.
I am using lagom µ-services holding all entities. And at the client side the GUI is using special case class which encapusle the entity data. More and special things are not relevant for this.

My problem is, i reload the entire entities because they could change from other side. And if i throw the SFXBean away the gui is reloading all. So I want only update the initial sfxbean with the mayben new data from the server.
I can set each field step by step like

bean.setValue("key",data)

To change all fields I have to do it like this way and by my self

  def updateCompleteBeanPatient(toUpdate: SFXBean[PatientViewFX], newValue: PatientViewFX): Unit = {
    newValue.productElementNames.toList.zip(newValue.productIterator.toList).foreach{tuple =>
      toUpdate.updateValue(tuple._1,tuple._2)
    }
  }

I prefere a more elegan solution. Maybe it is possible to enhance the SFXBean with the possibility to update the whole value (in this case PatientViewFX)?

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions