# model a web4 scenario usecase diagram

1. UcpComponents have UcpModels

2. UcpModels have a basich JSON object as value
   1. UcpModels have a model attribute, that is a proxy to the value
   2. The Model casts a modelChanged event if tne of the values attributes is changed
3. UcpComponents manage their UcpModel
   1. Setting the model of a UcpComponent stores the original JSONObject in the UcpModel value and creates a proxy as the model atrribute of the UcpComponent
   2. the data attribute of the UcpComponent is the reference to the original JSON object that is proxied by the model
   3. UcpModel have a UcpController
   4. The controller manages a list ov UCpViews for a UcpComponent
   5. A UcpComponent is a Component as a UcpModel is a Model. These general terms Model and Controller are Interfaces.
   6. UcpModel is a specific Model Implementation class following the UCP standard.
   7. on casting a "modelChanged" Event, all views have to be rerendered to reflect the model change
4. Models can be serialized into a UcpScenario which is a UcpComponent
5. UcpScenarios therfore have a model that serialize original model into primitive values that can be transfered as a JSON string.
   1. if the attibute is not a primitive value it is treared as a relationship to another object.
   2. relationships can be expressed as IOR stings: Internet Object references.
   3. IORs are more feature rich object oriented URLs
   4. as a URL can be expressed as a string, an IOR can also be expressed as a string and always starts with "ior:" as the main protocol int the URL. an IOR can list multiple protocols in a colon seperated list e.g. "ior:https:rest:hypermedia://localhost:port,hostprofile1:port1,hostprofile2:port/path/path1#anchor?queryParameter1=queryParameterValue1"
   5. each protocoll is implemented by a Loader
6. References my be from the multiplicity [0,1]
7. if the Reference is from the multiplicity [0,n] it is a Collection
8. Collections serialize as a collection descriptor describing an array of references
9. relations serialiye as a relationship descriptor with an IOR string.
10. IORs discover their Loaders by the sequence of Protocols they execute to load data
11. in Web4 all data is transfered as JSON objects
12. a UcpScenario can be created by loading a JSON Object via a ScenarioLoader which is a Loader.
13. if the UcpComponent is already existing, the UcpSceanrios model will be a serialisation of its data attribute
14. when a serialized scenario is loaded as a JSON Object, the UcpComponent can be creatd from the scenarios IOR
15. 