Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.5
-
Fix Version/s: 0.6
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Especially usefull for YSessionContext.
Constructor can't be used as YFaces#getRequestContext() would create a cyclic reference
----------
1) Command Pattern
Constructor creates an 'InitializeCommand' and adds it to a command queue
Impl:
static List YRequestContextImpl#getCommandQueue()
con:
- more complex than delegation
- no real place where the command queue is managed
pro:
- no isInitialized/setInitialized member needed
- context is not applicable for calling any parents context#init()
- better options for future enhancements (e.g. init on pages, conversation etc)
2) Delegatation of init() from YRequest up to YApplication
Impl:
starting with YRequestContext#init() each context is responsible for calling the parents
context #init() but only when parent context wasn't already initialized
disadvantage:
- a custom override of #init() always have to call super() (error prone)
- no chance of 'jump over' a context instance (stop init always stops whole init process)
- at least one useless boolean check is done with every request
3) Right now olny session gets considered
pro:
- easy to implement
- 80% of all use-cases
con:
- missing flexibility for future enhancements
Activity
Denny Strietzbaum
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Denny Strietzbaum
made changes -
| Summary | trigger initialization requests after spring has created all context objects | context initialization callback method |