#91 Collections: observable collections

Slēgta
ranides atvēra 3 gadi atpakaļ · 9 komentāri

Create adapters for Collection, List, Map, PrototypeMap, GenericMap

Every adapter will emit events to associated EventRouter

Create adapters for Collection, List, Map, PrototypeMap, GenericMap Every adapter will emit events to associated EventRouter
ranides komentēja 3 gadi atpakaļ
Īpašnieks

Maybe we should implement observable for:

  • Map
  • PrototypeMap
  • GenericMap
  • BeanModel

And create only one event: PropertyChange(key, prev, value)

Maybe we should implement observable for: - Map - PrototypeMap - GenericMap - BeanModel And create only one event: PropertyChange(key, prev, value)
ranides komentēja 3 gadi atpakaļ
Īpašnieks

We should support:

  • java.beans.PropertyChangeEvent
  • net.ranides.assira.event.PropertyChangeEvent
We should support: - java.beans.PropertyChangeEvent - net.ranides.assira.event.PropertyChangeEvent
ranides komentēja 3 gadi atpakaļ
Īpašnieks

At this moment our events model does not support synchronized events: it means we can't cancel event, we can't veto property change, etc

At this moment our events model does not support synchronized events: it means we can't cancel event, we can't veto property change, etc
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
ranides komentēja 3 gadi atpakaļ
Īpašnieks

We have:

  • Collection
  • List
  • Map
  • PrototypeMap
  • GenericMap
  • observable bean constructor
  • observable bean wrapper

Creating observable BeanModel is pointless essentially, because our "observable model" won't see changes introduced to object by direct calls.

Creation of "wrapper" for existing objects is quite questionable. We shouldn't write subclass which delegates to source, it will consume 2 times more memory. It is almost pointless.

We have: - [x] Collection - [x] List - [x] Map - [x] PrototypeMap - [x] GenericMap - [x] _observable bean constructor_ - [ ] _observable bean wrapper_ Creating observable BeanModel is pointless essentially, because our "observable model" won't see changes introduced to object by direct calls. Creation of "wrapper" for existing objects is quite questionable. We shouldn't write subclass which delegates to source, it will consume 2 times more memory. It is almost pointless.
ranides komentēja 3 gadi atpakaļ
Īpašnieks

we should be able to instantiate observable bean if there is no public default constructor, or no default constructor at all (by using some memory allocation trick)

we should be able to instantiate observable bean if there is no public default constructor, or no default constructor at all (by using some memory allocation trick)
ranides komentēja 3 gadi atpakaļ
Īpašnieks

todo: our collections are reused by other structures. In such case they emit "wrong" source:

  • ObservableIterator emits always CollectionEvent. If used by map, it emits event with source pointing to "entrySet", "keySet", "values" instead of MapEvent and corrent enclosing map

  • ObservableMap is used by ObservableGenericMap and ObservablePrototypeMap. It emits event with source pointing to "declaredMap" or event worse some other map inside prototype.

ObservablePrototypeMap is especially complicated. What to do if we change something inside prototype directly? We should emit source as "prototype map" of course. But what if we modified it indirectly? Should we emit source as "enclosing map"? Maybe it is irrelevant question because it is impossible to modifiy prototype indirectly.

Anyway, ObservablePrototypeMap should emit source as enclosing instance, not as internal "declared" map.

todo: our collections are reused by other structures. In such case they emit "wrong" source: - ObservableIterator emits always CollectionEvent. If used by map, it emits event with source pointing to "entrySet", "keySet", "values" instead of MapEvent and corrent enclosing map - ObservableMap is used by ObservableGenericMap and ObservablePrototypeMap. It emits event with source pointing to "declaredMap" or event worse some other map inside prototype. ObservablePrototypeMap is especially complicated. What to do if we change something inside prototype directly? We should emit source as "prototype map" of course. But what if we modified it indirectly? Should we emit source as "enclosing map"? Maybe it is irrelevant question because it is impossible to modifiy prototype indirectly. Anyway, ObservablePrototypeMap should emit source as enclosing instance, not as internal "declared" map.
ranides komentēja 3 gadi atpakaļ
Īpašnieks

comment about rebinding: it is impossible to set correct binding at construction time (enclosing collection is not constructed yet).

Maybe the best option is to write new type of EventRouter which transforms/rewrites event inside "signalEvent" method?

comment about rebinding: it is impossible to set correct binding at construction time (enclosing collection is not constructed yet). Maybe the best option is to write new type of EventRouter which transforms/rewrites event inside "signalEvent" method?
ranides komentēja 3 gadi atpakaļ
Īpašnieks

todo: we should fix ObservableIterator in the same way as ObservableMap (we should create subclasses, instead of using simple class)

todo: we should fix ObservableIterator in the same way as ObservableMap (we should create subclasses, instead of using simple class)
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
ranides komentēja 3 gadi atpakaļ
Īpašnieks

todo: test

todo: test
ranides pieminēja šo problēmu revīzijā 3 gadi atpakaļ
Pierakstieties, lai pievienotos šai sarunai.
Nav atskaites punktu
Nav atbildīgā
1 dalībnieki
Notiek ielāde...
Atcelt
Saglabāt
Vēl nav satura.