Comments (4)
Really?
METHOD update_and_save.
update_without_saving( ).
COMMIT WORK.
ENDMETHOD.
Splitting into update
and save
cuts a different seam, leading to a different pattern for the consumer:
update( ).
save( ).
May also be valid of course, but not what the example set out to demonstrate. :-)
from styleguides.
No.. it's exact the same example, just the wording is clearer.
METHOD save.
update( ).
COMMIT WORK.
ENDMETHOD.
With the enhanced example here I got more problems than before. That mean you would code the update table ... into the method and just hope, that there will not be an implicit commit.
So maybe it's complete wrong.
update_internal( ).
update_db( ).
--> then it makes also sense when there is this inside:
METHOD update_db.
update_internal( ).
UPDATE TABLE ... from whatever.
COMMIT WORK.
ENDMETHOD.
from styleguides.
I'd still not say there is something "wrong" with any of these examples. It just sounds like we have different ideas of what the terms "update" and "save" mean, and what the overall structure of the code could be. :-)
A more complete example could be:
" public
METHOD modify_db_without_comitting.
modify_db( ).
ENDMETHOD.
" public
METHOD modify_db_and_commit.
modify_db( ).
commit( ).
ENDMETHOD.
" private
METHOD modify_db.
MODIFY <db_table> FROM <member_attribute>.
ENDMETHOD.
" private
METHOD commit.
COMMIT WORK.
ENDMETHOD.
There are three prevalent cases for Boolean input parameters:
- a. To set a Boolean attribute. In this case, the Boolean input is fine.
- b. To choose a fully alternative implementation of the method.
- c. To switch on an additional side feature within the method, like in the example here.
Should we try and find a suitable case b. example to avoid the kind of misunderstandings with case c. examples we see here?
from styleguides.
The community has not responded to @HrFlorianHoffmann proposals
from styleguides.
Related Issues (20)
- Strategy for handling dependencies to system releases HOT 4
- Text on logo not readable in dark mode (Code Review Guide) HOT 3
- [Exploit the test tools] Add CL_AUNIT_AUTHORITY_CHECK to the list? HOT 6
- [Consider decomposing complex conditions] bad use case example HOT 1
- German Translation: Typo HOT 1
- Use assert class instead of ASSERT HOT 12
- Are comments bad or not?
- [Use CHANGING sparingly, where suited] Is it ok to use IMPORTING REF instead of CHANGING? HOT 7
- New rule: prefer inferring types HOT 1
- Abap Exception categories HOT 3
- Use READ-ONLY sparingly - new abap command FINAL HOT 2
- How to add sample code to Clean ABAP? HOT 1
- Unclear explanation of [Use LOCAL FRIENDS to access the dependency-inverting constructor] HOT 5
- Follow rules when abbreviating HOT 1
- "Dead" link at section "split-method-instead-of-boolean-input-parameter" HOT 3
- Chapter "Avoid abbreviations" HOT 7
- [Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE] In defense of RAISE EXCEPTION TYPE HOT 6
- Prefer ENUM to constants interfaces HOT 1
- [Use | to assemble text] Is a caveat needed in case of translatable texts? HOT 7
- "New rule" Tables > Prefer a Table Expression to READ TABLE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from styleguides.