While the core manual (and other documentation) of Vert.x shows several use cases and gives good explanations of Vert.x in general, I am curious what are do and donts when designing verticle classes.
Preword: I am aware of that the design of Vert.x is in general AGAINST giving strict design guidelines. So, no need to mention this in answers.
An example that led me to this question is as following. I created a verticle named ServiceDiscoveryVerticle.java which has the following responsibilities:
- read in a configuration file of services and then publish them via the Vert.x ServiceDiscovery
- manage services additionaly in lists(published/unpublished) to keep track of unpublished ones
- receive messages via the event bus, for either publishing or unpublishing a certain service
All this is code is manifested in the overriden start method.
So the core questions I ask in this questions are:
- What are do and donts when designing verticle classes ? (by your personal prefence/opinion)
- Are there any general guidelines of what belong to a verticle and what not ? (officialy or community-wise)
- Is it recommandable to split the start method up into private methods (if so, should it be in the same class or better put in a seperate one like OwnServiceDiscovery.java) ?
- Any other ideas/remarks on my given example(ServiceDiscoveryVerticle.java) ?