Mantis Bug Tracker

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000903AmarilloDeploymentpublic2014-06-15 22:032014-06-19 10:50
ReporterFred 
Assigned ToFred 
PrioritynormalSeveritymajorReproducibilityN/A
StatusclosedResolutionfixed 
PlatformAllOSAllOS VersionAll
Product Version0.1-SNAPSHOT 
Target Version0.1Fixed in Version0.1 
Summary0000903: Move away from static setup to IOC
DescriptionUsing the main method for all setup, though easy, is a bit ugly in the context of a deployable web app. Change away from this to use some type of IOC.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
User avatar (0002783)
Fred (administrator)
2014-06-16 04:58

Some work done toward this issue in 463a3f27192c6af98315761e51afcf14a48910d8
User avatar (0002786)
Fred (administrator)
2014-06-16 10:29

Better in 95cb76de350b70c081e375b234f9643fa4319b8d, may not go to IOC at all. We'll see. This can stay open until further decisions are made either way.
User avatar (0002790)
Fred (administrator)
2014-06-16 22:40

Changed back to two static methods in 66154bf21c9a58f588590d3f622fe721e5fc1ae6 and formed a game plan.

The plan is:

When moving from stubs to actual code that does something, create actual classes that extend Route and supply an instance of these classes during the setup. This will keep the static setup concise and separate the code for different functionalities. The down side will remain having to create and distribute objects in this init location.

What may be able to be done is add a second init param to the annotation in SparkServlet, whereby an IOC container could be called first, let it spread the objects around, then call into the init routine. We'll cross that bridge when we come to it, though.
User avatar (0002810)
Fred (administrator)
2014-06-19 10:50

No IOC added, however the setup code is now pretty clean as of 9c7fc8b29acf19f76c0f9bd7280b76eb5b3c0167, or a bit earlier. Closing.


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker