com.sysord.mad.mao
Interface ModelAccessObject


public interface ModelAccessObject

Service for reading and persisting edited model elements.

This service is essentially used to load and update the values of the widgets of a view.

The write accesses are all done into EMF transactions via TransactionalMadCommands.

Author:
philippe.palau@sysord.com http://www.sysord.com
See Also:
ModelElementView, TransactionalMadCommand, TransactionalCommandProvider

Method Summary
 MadCommand createTransactionnalMadCommand(ValuedSemanticElement processedElement, MadCommand baseCommand)
          Creates a transactionnal command for executing the base MadCommand in an EMF transaction.
 void loadViewValues(ModelElementView modelElementView)
          Sets value for all elements in the given modelElementView.
 void loadWidgetValue(Widget<?> widget)
          Loads the value from the owner model and set it to the given widget.
 void persistViewValues(ModelElementView modelElementView)
          View values are persisted into their owner model.
 void persistWidgetValue(Widget<?> widget)
          Widget value is persisted in its owner model.
 

Method Detail

loadViewValues

void loadViewValues(ModelElementView modelElementView)
                    throws MaoException
Sets value for all elements in the given modelElementView.

Values are requested from models and affected to element in the view.

Parameters:
modelElementView - The view into which loading the values.
Throws:
MaoException

persistViewValues

void persistViewValues(ModelElementView modelElementView)
                       throws MaoException
View values are persisted into their owner model.

Parameters:
modelElementView -
Throws:
MaoException

persistWidgetValue

void persistWidgetValue(Widget<?> widget)
                        throws MaoException
Widget value is persisted in its owner model.

Parameters:
widget - The widget containing the value to persist.
Throws:
MaoException

loadWidgetValue

void loadWidgetValue(Widget<?> widget)
                     throws MaoException
Loads the value from the owner model and set it to the given widget.

Parameters:
widget - The widget into which the value will be put.
Throws:
MaoException

createTransactionnalMadCommand

MadCommand createTransactionnalMadCommand(ValuedSemanticElement processedElement,
                                          MadCommand baseCommand)
Creates a transactionnal command for executing the base MadCommand in an EMF transaction.

Parameters:
processedElement - The element to update.
baseCommand - The base command to execute into an EMF transaction.
Returns:
The created TransactionalMadCommand.