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

Cached decorator (FakeConnection class in EO Vol 2) #14

Open
fabriciofx opened this issue May 29, 2019 · 0 comments
Open

Cached decorator (FakeConnection class in EO Vol 2) #14

fabriciofx opened this issue May 29, 2019 · 0 comments

Comments

@fabriciofx
Copy link
Owner

fabriciofx commented May 29, 2019

In Elegant Object Vol. 2, section 6.5.6 Too many round trips, Yegor discuss about the problem of many round trips to RDBMS, to fetch data from each SQL Speaking Object (SSO). A solution to this problem is use a FakeConnection class (here it will be called Cached) that will cache all data of each SSO. But to implement a caching decorator to JDBC API it isn't trivial. We need implement a SQL parser and analyser to check each SQL statement to perform correctly (store or retrieve) data.
The API to be used by the developer should be something like:

public final class Cached implements Session {
 ...
}

final Session session = new Cached(
  new SessionAuth(
    new SourceH2l("test"),
    "foo",
    "bar")
  )
);
@fabriciofx fabriciofx changed the title FakeConnection (caching subsystem) Cached decorator (FakeConnection class in EO Vol 2) May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant