Spring-boot: Replace SpringApplication.run(Object) with type safe variants

Created on 11 May 2017  路  3Comments  路  Source: spring-projects/spring-boot

The SpringApplication.run(Object) API isn't very friendly for Ceylon and it isn't typesafe so the IDE can't help with suggestions. See this twitter conversation for background.

In 2.0 we can replace it with overloaded versions and possibly consider dropping some of the more exotic versions.

enhancement

Most helpful comment

@wilkinsona After digging into this a bit I think we can simply the API quite a bit. If we make run take Class<?> arguments, and getSources() take String arguments most people can probably still do what they need.

I doubt the Resource and Pacakge variants are used that often so we can probably just drop those. I'm tempted to try this in M1 and see who complains.

All 3 comments

I wonder if we should add the new methods and deprecate SpringApplication.run(Object) in 1.5.x?

@wilkinsona After digging into this a bit I think we can simply the API quite a bit. If we make run take Class<?> arguments, and getSources() take String arguments most people can probably still do what they need.

I doubt the Resource and Pacakge variants are used that often so we can probably just drop those. I'm tempted to try this in M1 and see who complains.

Thanks, this looks perfect!

Was this page helpful?
0 / 5 - 0 ratings