The traditional OOP view is that the constructor should guarantee that an object is in its final, usable state -- that is, the state may change, of course, if there are dynamically changing requirements (e.g. is there a disconnect
method to go with that connect
, and an actual app requirement to enable the dynamic changing of routing in the course of operations?), but it "should" stay usable from the moment the object is born, to when it goes away.
In the real world, the alternative pattern sometimes known as "two-phase construction" (though here it might be more than just two phases of course, as you keep calling connect
;-) may have some advantages in terms of flexibility -- persisting and de-persisting objects, building them right dependently on configuration files, easing dependency injection and mocking (and therefore testing).
Whether you're actually going to take advantage of these flexibility aspects, is a question you can answer better than we can... since you best know your app's exact requirements and your own skill and preferences in OO development, testing, &c. If you're not, in fact, going to use the flexibility aspects, then it's simpler to omit them altogether, and go with the "traditional self-sufficient constructor" OOP approach.