Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ea944f06
Commit
ea944f06
authored
Sep 06, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Our markdown renderer doesn't like those newlines
parent
92a4c59b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
doc/development/ee_features.md
doc/development/ee_features.md
+3
-8
No files found.
doc/development/ee_features.md
View file @
ea944f06
...
@@ -75,12 +75,11 @@ There are a few gotchas with it:
...
@@ -75,12 +75,11 @@ There are a few gotchas with it:
-
when the original implementation contains a guard clause (e.g.
-
when the original implementation contains a guard clause (e.g.
`return unless condition`
), we cannot easily extend the behaviour by
`return unless condition`
), we cannot easily extend the behaviour by
overriding the method, because we can't know when the overridden method
overriding the method, because we can't know when the overridden method
(i.e. calling
super
in the overriding method) would want to stop early.
(i.e. calling
`super`
in the overriding method) would want to stop early.
In this case, we shouldn't just override it, but update the original method
In this case, we shouldn't just override it, but update the original method
to make it call the other method we want to extend, like a
[
template method
to make it call the other method we want to extend, like a
[
template method
pattern
](
https://en.wikipedia.org/wiki/Template_method_pattern
)
.
pattern
](
https://en.wikipedia.org/wiki/Template_method_pattern
)
.
For example, given this base:
For example, given this base:
```
ruby
```
ruby
class
Base
class
Base
def
execute
def
execute
...
@@ -91,10 +90,8 @@ There are a few gotchas with it:
...
@@ -91,10 +90,8 @@ There are a few gotchas with it:
end
end
end
end
```
```
Instead of just overriding
`Base#execute`
, we should update it and extract
Instead of just overriding
`Base#execute`
, we should update it and extract
the behaviour into another method:
the behaviour into another method:
```
ruby
```
ruby
class
Base
class
Base
def
execute
def
execute
...
@@ -111,9 +108,8 @@ There are a few gotchas with it:
...
@@ -111,9 +108,8 @@ There are a few gotchas with it:
end
end
end
end
```
```
Then we're free to override that
`do_something`
without worrying about the
Then we're free to override that
`do_something`
without worrying the guards:
guards:
```
ruby
```
ruby
module
EE::Base
module
EE::Base
def
do_something
def
do_something
...
@@ -121,7 +117,6 @@ There are a few gotchas with it:
...
@@ -121,7 +117,6 @@ There are a few gotchas with it:
end
end
end
end
```
```
This would require updating CE first, or make sure this is back ported to CE.
This would require updating CE first, or make sure this is back ported to CE.
When prepending, place them in the
`ee/`
specific sub-directory, and
When prepending, place them in the
`ee/`
specific sub-directory, and
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment