Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(406)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 63530048: upgrades: remove unnecessary indirection layer

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by rog
Modified:
11 years, 10 months ago
Reviewers:
mp+206361, fwereade
Visibility:
Public.
upgrades: remove unnecessary indirection layer The upgrade description is just data - it doesn't need any behaviour associated with it, so it's sufficient, simpler and more direct to just use structs where we can, making the code easier to understand and shorter. https://code.launchpad.net/~rogpeppe/juju-core/502-upgrades-simplify/+merge/206361 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : upgrades: remove unnecessary indirection layer #

Created: 11 years, 11 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -196 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M upgrades/lockdirectory.go View 1 chunk +2 lines, -2 lines 0 comments Download
M upgrades/lockdirectory_test.go View 2 chunks +4 lines, -2 lines 0 comments Download
M upgrades/operations.go View 1 chunk +5 lines, -10 lines 0 comments Download
M upgrades/rsyslogconf.go View 3 chunks +7 lines, -7 lines 0 comments Download
M upgrades/rsyslogconf_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M upgrades/steps118.go View 1 chunk +13 lines, -16 lines 0 comments Download
M upgrades/upgrade.go View 5 chunks +21 lines, -75 lines 0 comments Download
M upgrades/upgrade_test.go View 5 chunks +79 lines, -80 lines 0 comments Download
Total messages: 3
|
rog
Please take a look.
11 years, 11 months ago (2014年02月14日 09:20:19 UTC) #1
Please take a look.
Sign in to reply to this message.
fwereade
AFAICS, this just makes the code harder to change. Opinions may reasonably differ re likelihood ...
11 years, 10 months ago (2014年02月17日 10:34:34 UTC) #2
AFAICS, this just makes the code harder to change. Opinions may reasonably
differ re likelihood of changes that'd cause the interface implementation to pay
off, but IME the aggregated cost of designing for change is trivial compared to
the cost of failing to do so, and so a CL that just removes flexibility does not
lgtm.
Sign in to reply to this message.
rog
On 17 February 2014 10:34, <fwereade@gmail.com> wrote: > AFAICS, this just makes the code harder ...
11 years, 10 months ago (2014年02月17日 12:24:43 UTC) #3
On 17 February 2014 10:34, <fwereade@gmail.com> wrote:
> AFAICS, this just makes the code harder to change. Opinions may
> reasonably differ re likelihood of changes that'd cause the interface
> implementation to pay off, but IME the aggregated cost of designing for
> change is trivial compared to the cost of failing to do so, and so a CL
> that just removes flexibility does not lgtm.
For the record, my view is precisely the opposite in this case.
For methods that simply return some data, it is easier just
to have a field containing the data rather than an extra method
to call that returns the data and an interface type that encapsulates
that.
Adding an extra layer of indirection does *not* make things easier
to change, particularly when we are talking about a package-internal
detail here.
Any change is likely to require changes to the signature of the interface
type, and therefore to the user of that type. Given that, we may as well
just store the data in fields and avoid the need to change all the
interface implementations as *well* as the users of the type.
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /