I recently had similar thoughts on updating GeoServer with annotations
and believe it may be smart to think about a broader modernization effort
for GeoServer. The way GeoServer currently defines controllers is quite
dated. I recently reached out for support on one of the Spring gitter.im
chat rooms and Dave Syer, a well-known and respected Spring contributor
asked me "why aren't you mapping URLs with annotations like the rest of the
world" and had concerns about the usage of AbstractControllers in the
current Spring ecosystem.
Although this thread is focused on controllers, I think opening a
discussion about a tiered approach to modernizing the entire code base is a
good idea. Here are a few ideas that have been burning in the back of my
head for a bit now:
1. On a module by module basis, replace all bean definitions in
applicationContext.xml with class annotations. The classes would obviously
also require @Autowire or @Inject annotations to pull in any dependencies
defined in the xml.
2. The servlet 3.x spec no longer requires web.xml. All xml based
config could be replaced with JavaConfig. In my personal opinion,
JavaConfig is much cleaner and easier to read/modify.
3. Building out JavaConfig from scratch can be daunting as the entire
config needs to be stood up from scratch in unison to have a working
project. As an alternative, Spring Boot could be implemented which
provides default JavaConfig classes for any Spring Boot managed
dependencies with sensible defaults. Most common configuration options can
be managed from an application.properties file. More advanced
configuration can still be implemented in @Configuration classes.
I'm a new guy here so don't beat me up too badly :) Just wanted to throw
out ideas for a larger modernization effort.
On Thu, Jul 7, 2016 at 5:51 PM, Nuno Oliveira <
[email protected]> wrote:
> Hi,
>
> Thanks for the feedback Andrea and Justin.
> I activate the package scanning only for package org.geowebcache.sqlite
> and didn't notice any effect on build time and GeoServer startup time.
>
> Le dimanche 03 juillet 2016 à 20:44 +0000, Justin Deoliveira a écrit :
>
> Yeah, enabling package scanning for a large package (like org.geoserver)
> you would see a noticeable hit as spring starts up.
>
> What I find works best is to enable package scanning and use of
> annotations on a module by module basis where you turn it on only for
> specific packages.
>
> $0.02
>
> On Sun, Jul 3, 2016 at 2:21 PM Andrea Aime <[email protected]>
> wrote:
>
> On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <
> [email protected]> wrote:
>
> What is community opinion about using spring annotations ?
>
>
> No objection here, as long as they don't visibly affect build times (some
> of this magic might require
> Spring to do classpath scans).
>
> Cheers
> Andrea
>
> --
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054 Massarosa (LU)
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
>
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
> -------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape_______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
> --
> ==
> GeoServer Professional Services from the experts!
> Visit http://goo.gl/it488V for more information.
> ==
> Nuno Miguel Carvalho Oliveira
> @nmcoliveira
> Software Engineer
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 333 8128928
> http://www.geo-solutions.ithttp://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
> AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
> Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
> file/s allegato/i sono
> da considerarsi strettamente riservate. Il loro utilizzo è consentito
> esclusivamente al destinatario del messaggio, per le finalità indicate
> nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il
> destinatario, Vi preghiamo cortesemente di darcene notizia via e
> -mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal
> Vostro sistema. Conservare il messaggio stesso, divulgarlo
> anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per
> finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of
> the named addressee(s) and may be confidential or proprietary in nature or
> covered by the provisions of privacy act (Legislative Decree
> June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in
> accord with its purpose, any disclosure, reproduction, copying,
> distribution, or either dissemination, either whole or partial, is strictly
> forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender does
> not give any warranty or accept liability as the content,
> accuracy or completeness of sent messages and accepts no responsibility for
> changes made after they were sent or for other risks which
> arise as a result of e-mail transmission, viruses, etc.
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
--
Josh Fix
(636) 293-6011
Systems Architect | Boundless <http://boundlessgeo.com/>
[email protected]
@boundlessgeo <http://twitter.com/boundlessgeo/>
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel