-
Notifications
You must be signed in to change notification settings - Fork 94
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
refactoring about onlinejudge.service.*.*Content #464
Milestone
Comments
kmyk
added a commit
that referenced
this issue
Jul 21, 2019
Merged
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 18, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
kmyk
added a commit
that referenced
this issue
Aug 21, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
model に対する理解の不足から来た設計ミスがあります。適当なタイミングで修正する必要があります。
onlinejudge.type.Submission
のようなクラスは、おそらくメソッドの生えた URL 文字列と認識されるべきです。もしそれ以上の役割を持つならすぐに破綻するからです。特に、何らかの得られたデータのキャッシュを持ってしまうと「どのような session から得られたいつの時点でのキャッシュなのか」「複数の session が与えられた場合どうなるべきか」「通信が発生するのかキャッシュが参照されるのかの判別ができない」などの困難が発生します。
たとえば現状では
onlinejudge.service.atcoder.AtCoderContest
は以下のようにキャッシュを保持してしまっています。そして実際に、「過去のコンテスト一覧 https://atcoder.jp/contests/archive から取得されたデータで半分ぐらいキャッシュが埋まっている状態」と「コンテストページ https://atcoder.jp/contests/abc130 を読んだ後のすべてキャッシュが埋まっている状態」の区別や、その際の言語設定が「英語」か「日本語」かによるデータの違いなどがとても曖昧になっています。これは単に、文字列
https://atcoder.jp/contests/abc130
と同一視できるクラスAtCoderContest
と、ある 1 回の通信の結果を表現する namedtupleAtCoderContestContent
のふたつへ分割することで解決できます。https://github.com/kmyk/online-judge-tools/blob/60a5b937d9978cc96a83d08c7fc6fbeec6d526a4/onlinejudge/service/atcoder.py#L149-L167
The text was updated successfully, but these errors were encountered: