ales808 / navigator7

Automatically exported from code.google.com/p/navigator7
0 stars 0 forks source link

Customize page instantiation strategy #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
New Feature Request
-------------------
Problem:
Currently page instantiation is done by PageInvocation.getPageInstance() 
through the pageClazz.newInstance() call. This prevents anyone from using a DI 
framework (without relying on AOP) as Spring and OSGi. 

Solution:
Enable a developer to customize the instantiation strategy by defining a 
PageInvocation.PageInstantiationStrategy and having WebApplication implement a 
getPageInstantiationStrategy() method (which returns a default strategy that 
uses the pageClazz.newInstance). This way a developer only has to overwrite the 
method in order to use whatever strategy he wants.

Additional information:
I'm not sure if WebApplication is the best place to have the 
getPageInstantiationStrategy() so move it around if you know a better place. 
Same with the class and methods naming.

Patch is attached.

Original issue reported on code.google.com by tda...@gmail.com on 26 Jun 2011 at 3:24

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, it is very cool feature. I was evaluating N7 with Spring/AspectJ for a few 
months and now I have to switch to JEE environment. Without this patch the 
migration wouldn't be possible. Many thanks!! 

Original comment by lukasz.c...@gmail.com on 5 Aug 2011 at 8:36

GoogleCodeExporter commented 8 years ago
Is it planned to apply it to trunk?

Original comment by jecuendet on 21 Dec 2011 at 2:59