Skip to content

Refactor demo apps: improve naming conventions and code structure#589

Merged
oblomov-dev merged 6 commits intostandardfrom
claude/refactor-folder-02-apps-o3ncB
Mar 15, 2026
Merged

Refactor demo apps: improve naming conventions and code structure#589
oblomov-dev merged 6 commits intostandardfrom
claude/refactor-folder-02-apps-o3ncB

Conversation

@oblomov-dev
Copy link
Copy Markdown
Member

Summary

This PR refactors multiple demo application classes to improve code quality, readability, and consistency. The changes focus on standardizing naming conventions, simplifying string concatenation syntax, and improving code organization.

Key Changes

Naming Convention Updates:

  • Removed mv_ prefix from instance variable names across demo apps 359, 360 (e.g., mv_priceprice, mv_first_namefirst_name)
  • Removed lv_ prefix from local variable names (e.g., lv_float_bindfloat_bind, lv_concatconcat)
  • Removed iv_ prefix from method parameters in demo app 357 (e.g., io_rowrow, iv_iconicon)
  • Renamed type definition in demo app 358 from ty_product to ty_s_product for consistency
  • Renamed table variable in demo app 358 from mt_products to t_products

Code Structure Improvements:

  • Removed CREATE PUBLIC clause from class definitions (changed to DEFINITION PUBLIC only)
  • Added blank lines between method definitions for better readability
  • Extracted initialization logic in demo app 355 into separate on_init() and view_display() methods
  • Moved client reference assignment to the beginning of main() method in demo app 355

String Concatenation Modernization:

  • Converted multi-line string concatenations to inline template literals using |...| syntax in demo apps 359 and 360
  • Improved readability of complex binding expressions by using template string interpolation

Code Organization:

  • Added blank lines after class definition sections for visual separation
  • Consistent method ordering and spacing throughout all modified classes

Notable Implementation Details

  • All functional behavior is preserved; these are purely refactoring changes
  • The changes improve code maintainability by following more modern ABAP naming conventions
  • Template literal syntax makes binding expressions more readable and easier to maintain

https://claude.ai/code/session_01GwFbxdvWVuf3iKjN5VhHrb

claude added 6 commits March 15, 2026 16:17
- Remove CREATE PUBLIC from all class definitions
- App 355: extract on_init and view_display, add client attribute to PROTECTED SECTION
- App 357: remove iv_/io_ prefixes from add_cell parameters
- App 358: rename ty_product -> ty_s_product, mt_products -> t_products; remove blank line between TYPES and DATA
- App 359: remove mv_ prefix from attributes, lv_ from locals; convert && concatenation to string templates
- App 360: remove mv_ prefix from attributes, lv_ from locals; convert && concatenation to string templates
- Fix blank lines in all methods (start/end, before IF, 2 lines between methods)

https://claude.ai/code/session_01GwFbxdvWVuf3iKjN5VhHrb
Align p directly under n in all ->_() and ->__() method calls
where p appears on the continuation line. Also fix VALUE #( tuple
continuation indentation to match.

https://claude.ai/code/session_01GwFbxdvWVuf3iKjN5VhHrb
- Add blank line before view_display() in on_init methods to separate
  data initialisation from display logic
- Break method chains after each ->__() call so each chained call
  starts on its own line (e.g. root->__(`Shell`) on one line,
  )->__( n = `Page` ...) on the next)

https://claude.ai/code/session_01GwFbxdvWVuf3iKjN5VhHrb
- PRIVATE SECTION must always be empty; use PROTECTED SECTION at most
- Setup methods (on_init): blank line between last assignment and first
  non-assignment statement (e.g. before view_display())
- z2ui5_cl_util_xml chaining: each ->_() / ->__() call on its own line
- z2ui5_cl_util_xml p alignment: p must align directly under n
- VALUE #() formatting: all fields inline or each on its own line, no mix

https://claude.ai/code/session_01GwFbxdvWVuf3iKjN5VhHrb
@oblomov-dev oblomov-dev merged commit 4a51171 into standard Mar 15, 2026
6 checks passed
@oblomov-dev oblomov-dev deleted the claude/refactor-folder-02-apps-o3ncB branch March 15, 2026 16:51
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

Successfully merging this pull request may close these issues.

2 participants