Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues 174, 101 missing technical specs #199

Closed
marcuss opened this issue Apr 21, 2015 · 5 comments
Closed

Issues 174, 101 missing technical specs #199

marcuss opened this issue Apr 21, 2015 · 5 comments

Comments

@marcuss
Copy link

marcuss commented Apr 21, 2015

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.

@davvd @yegor256

@yegor256 yegor256 added the bug label Apr 22, 2015
@yegor256 yegor256 self-assigned this Apr 22, 2015
@davvd davvd added this to the 1.0 milestone Apr 22, 2015
@davvd
Copy link

davvd commented Apr 22, 2015

@M4Solutions milestone set to 1.0 (correct me if I am wrong)

@davvd
Copy link

davvd commented Apr 22, 2015

@yegor256 this task is yours,go ahead

@davvd
Copy link

davvd commented Apr 22, 2015

@M4Solutions many thanks for the report, I topped your account for 15 mins, transaction 55933067

@yegor256
Copy link
Owner

@M4Solutions I'm thinking about it...

@yegor256
Copy link
Owner

@marcuss we should use toString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants