[Geoserver-devel] Using spring annotations to configure REST controllers

Hi,

Sorry for the cross posting.

Right now in GeoServer and GWC spring annotations are not used.

I really miss spring annotations when defining rest interfaces, in my opinion annotations really improve readability.

For example defining a rest resource to upload a file using spring annotations:

@Controller
@RequestMapping("**/files")
public class UploadResource {

    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    public @ResponseBody ResponseEntity<String> upload(@RequestParam(value = "file", required = true) MultipartFile file) {
      (...)
      return ResponseEntity.status(HttpStatus.OK).body("File stored !");
    }

What is community opinion about using spring annotations ?

Regards,

Nuno Oliveira

--

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.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.

On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <
nuno.oliveira@anonymised.com> 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.

-------------------------------------------------------

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 6:20 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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.


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.

···

On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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.


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 :slight_smile: Just wanted to throw out ideas for a larger modernization effort.
···

On Thu, Jul 7, 2016 at 5:51 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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 <andrea.aime@anonymised.com.> wrote:


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
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-- 
==
GeoServer Professional Services from the experts! 
Visit [http://goo.gl/it488V](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.it](http://www.geo-solutions.it)
[http://twitter.com/geosolutions_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
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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.


Josh Fix
(636) 293-6011
Systems Architect | Boundless
jfix@anonymised.com
@boundlessgeo

Hi Josh,
modernization efforts are welcomed, provided they are done right, the issue is that normally people want to propose the idea but not take on the effort :slight_smile:
Done right means:

  1. The idea gets socialized and everybody is on board
  2. The shift is provided in controlled steps, both to allow existing developers to get proficient with the new approach and to avoid destabilizing too much the software (more on this later)
  3. Strictly related to the two above, the change will make you or others willing to participate and maintain (drop and run contributions can result in mixed reactions), or the existing maintainers are eager to get it anyways (e.g., they think it will make their work easier)
  4. The change does not incur in significant slowdowns at runtime or during build time
  5. The changes are proposed in a format that’s compatible with the time boxed release model
  6. You can rally up enough resources to perform the change. It’s up to the proponent to find such resources, hopefully you can get people and companies excited
    Long story short, in my opinion modernizing is good, but should be done one smallish step at a time over a long(ish) term plan. The largest jump we can do without bleeding is probably a one week code sprint like the one wicket 7 upgrade sprint (with the planning, sponsoring, and desire for companies to in-kind dev time required to make that happen).

Cheers
Andrea

···

On Fri, Jul 8, 2016 at 1:37 PM, Josh Fix <jfix@anonymised.com> wrote:

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 :slight_smile: Just wanted to throw out ideas for a larger modernization effort.

On Thu, Jul 7, 2016 at 5:51 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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 <andrea.aime@anonymised.com> wrote:


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
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-- 
==
GeoServer Professional Services from the experts! 
Visit [http://goo.gl/it488V](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.it](http://www.geo-solutions.it)
[http://twitter.com/geosolutions_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
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Josh Fix
(636) 293-6011
Systems Architect | Boundless
jfix@anonymised.com
@boundlessgeo

On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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.


==
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.


[corporate lurker chiming in]

This is definitely of interest to Boundless and we’ll be happy to sponsor code sprints as well as have developers work it as their day job…

From what we’ve seen in R&D already it should be possible (but not ideal) to maintain a mixed annotation/xml config for a bit while various extensions get up to speed. The controllers are a bigger issue though as the endpoints don’t seem to get mapped the same way with spring-boot — upgrading those can be done independently of the annotation upgrades though.

Justin has a good point about excessive classpath scanning but perhaps some package name conventions (e.g. org.geoserver.config, org.geoserver.ext.config) could alleviate that.

We’ll start shelling out an upgrade plan and socialize it around in the next month or two…maybe talk it over in Bonn?

Cheers,

Tom Ingold

VP, Product
Boundless
Desk: 202.827.0299
Mobile: 813.784.4151

···

On Fri, Jul 8, 2016 at 1:37 PM, Josh Fix <jfix@anonymised.com> wrote:

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 :slight_smile: Just wanted to throw out ideas for a larger modernization effort.

On Thu, Jul 7, 2016 at 5:51 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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 <andrea.aime@anonymised.com> wrote:


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
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--  
==
GeoServer Professional Services from the experts!  
Visit [http://goo.gl/it488V](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.it](http://www.geo-solutions.it)
[http://twitter.com/geosolutions_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
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Josh Fix
(636) 293-6011
Systems Architect | Boundless
jfix@anonymised.com
@boundlessgeo

On Sun, Jul 3, 2016 at 6:20 PM, Nuno Oliveira <nuno.oliveira@anonymised.com> 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.


==
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.