You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
but when more traditional enterprise schemes jump in, including long class names, long variable names, multiple dependencies, an IOC/DI container, etc, this syntax needs to be split over multiple lines.
So far our convention I've been going with is something like this:
classOPYLConfigurationApplicator
@Inject constructor(
privateval eventBus:EventBus,
privateval compiler:EvaluableCompiler,
privateval dupeService:DeduplicatingVariableSymbolGeneratingService,
privateval graph:GraphModel
){
privateval whatever =//...//note the indentation level is 4, meaning the above constructor is double-indented
}
The double indentation is to make the constructor evocative of long parameter lists which, for us (as per an intelliJ default), are also double-indented on each parameter.
Some other questions:
how does this change when implementing many interfaces and/or extending a base class
is the newline before @Inject superfluous?
The text was updated successfully, but these errors were encountered:
For smaller classes, such as data classes and smaller objects, the primary constructor in-class-definition syntax is quite clear and concise:
but when more traditional enterprise schemes jump in, including long class names, long variable names, multiple dependencies, an IOC/DI container, etc, this syntax needs to be split over multiple lines.
So far our convention I've been going with is something like this:
The double indentation is to make the constructor evocative of long parameter lists which, for us (as per an intelliJ default), are also double-indented on each parameter.
Some other questions:
@Inject
superfluous?The text was updated successfully, but these errors were encountered: