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
Issues 174 and 171 talk about adding a toConsole() method to the interfaces Take and Response* , a first approach is proposed in the 171 issue discussion, but since those 2 Interfaces are the center of many things in the project, something special is required to accomplish that.
The platform architecture could be changed trying to accomplish that, for example.
1st Approach:
Create the ConsoleFriendly interface with the correspondent toConsole() method, and make Take and Respose inherit that.
Result:
Every single implementation of those two interfaces, including the inner anonymous classes will need to implement the toConsoleMethod().
btw it could look something like:
public String toConsole() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.toString();
}
Causing lots of code repetition.
2nd Approach:*
Convert those interfaces to abstract classes and give the implementation of the toConsole() method in two places of the system (Response and Take now abstract clases with a implemented toConsole method).
And this would imply remove all @Override annotations in the "act" methods all over the platform.
This or having to change the act method in Takes to:
public Response act(Request req) throws IOException{
return null;
}
Finally the 3rd Approach
And this one I like but I would need to research it's viability, and is about to create an aspect to add this behavior to the "toString" method of the required Interfaces implementation, but this one could be the slowest one.
Anyhow this sounds to me, like I need more documentation on what are the architectural guidelines of the platform so I can adhiere to them.
Issues 174 and 171 talk about adding a toConsole() method to the interfaces Take and Response* , a first approach is proposed in the 171 issue discussion, but since those 2 Interfaces are the center of many things in the project, something special is required to accomplish that.
The platform architecture could be changed trying to accomplish that, for example.
1st Approach:
Result:
Every single implementation of those two interfaces, including the inner anonymous classes will need to implement the toConsoleMethod().
btw it could look something like:
Causing lots of code repetition.
2nd Approach:*
Convert those interfaces to abstract classes and give the implementation of the toConsole() method in two places of the system (Response and Take now abstract clases with a implemented toConsole method).
And this would imply remove all
@Override
annotations in the "act" methods all over the platform.This or having to change the act method in Takes to:
Finally the 3rd Approach
And this one I like but I would need to research it's viability, and is about to create an aspect to add this behavior to the "toString" method of the required Interfaces implementation, but this one could be the slowest one.
Anyhow this sounds to me, like I need more documentation on what are the architectural guidelines of the platform so I can adhiere to them.
@davvd @yegor256
The text was updated successfully, but these errors were encountered: