| OS Tips and Tricks
OutSystems
Tips and Tricks
Project DO's and DON'Ts,
and what we can learn from comics
| OS Tips and Tricks| OS Tips and Tricks
Erik
Brzozowski
Senior OutSystems Consultant| Valuga
@
in
erik.brzozowski@valuga.nl
/erik-brzozowski-nl
| OS Tips and Tricks
Main topics
● Project
● Architecture
● Coding
● Processes Timers/BPT
| OS Tips and Tricks| OS Tips and Tricks
Project
| OS Tips and Tricks
Ask why
● Know the ultimate Goal
■ Design Sprint
● Know the problem you are solving
● Try to talk to everyone
■ Product owner
■ Techlead
■ Architect
■ Developers (also from other teams)
■ Users
| OS Tips and Tricks
Scary questions
● But is it possible?
● Will it work?
● Which option takes the least time?
● It’s only a temporary solution, it
doesn't have to be pretty
■ Nothing so permanent as a temporary
solution
Come up with suggestions and
solutions.
| OS Tips and Tricks
Backlog management
● Does this user story fit in the ultimate
goal
● Accept that some user stories will not be
built
● If you can’t prioritize this is an indication
that something is wrong
● Start with the most complex user stories
■ Bring the pain forward
| OS Tips and Tricks
Match with existing architecture
● When you know the what
● When you know the next thing
to build
● Recheck how this would fit in
the current landscape
| OS Tips and Tricks| OS Tips and Tricks
Architecture
https://xkcd.com/1667/
| OS Tips and Tricks
How to design
● Iterative process
■ Disclose
■ Organize
■ Assemble
3: Assemble 1: Disclose
2: Organize
iteration
| OS Tips and Tricks
Disclose
● User stories and roles
● Information architecture
● Integration technology
● UX expectations
3: Assemble 1: Disclose
2: Organize
iteration
| OS Tips and Tricks
Organize
● Group or split Business
concepts
● Place on a canvas
● Possibly disclose more
concepts
3: Assemble 1: Disclose
2: Organize
iteration
| OS Tips and Tricks
Assemble
● Match recommended
patterns
● Abstract external
systems
● Check the validation
rules
3: Assemble 1: Disclose
2: Organize
iteration
| OS Tips and Tricks
No side references
among orchestration
or end-user modules
● No end-user screens
● Read only entities
Assemble: Rule #1 layer modules (and applications)
● No business logic
● No core entities
● No role based logic
Core Layer
Core business services
Library layer
Non business services
End User Layer
User processes
Orchestration Layer
Cross application orchestration
No upward
references
| OS Tips and Tricks
Rule #2 don’t mix owners
Common application
Module 1 Module 3Module 2
Application 1
Module 1 Module 2
Application 2
Module 3Split
Who can make the call to
go to production?
| OS Tips and Tricks
Rule #3 don’t mix sponsors
One big application for 3 divisions
General
core 1
General
core 2
Core 1
Front end
division 1 Core 1
Front end
division 2 Core 1
Front end
division 3
Application
division 3
Application
division 2
Application
division 1
Common application
Core 1 Core 2
Core 1
Front end
division 1 Core 1
Front end
division 2 Core 1
Front end
division 3
Split
| OS Tips and Tricks
Most architectures start easy
What can go wrong?
● No time to refactor
● Architecture iterations stop
● No designs or documentation
● Team(members) change
● No patterns are used
● Violations are introduced
| OS Tips and Tricks| OS Tips and Tricks
Coding
| OS Tips and Tricks
Naming conventions
● Use meaningful names
● Use PascalCase
● Create folders for actions and for
structures
● Avoid empty labels
● Suffix foreign keys with Id
● Always group screens by name
● Set the name property of
TableRecords, ShowRecords and
ListRecords
| OS Tips and Tricks
Coding
● Always comment complex or
unclear logic
| OS Tips and Tricks
Coding
● Always comment complex or
unclear logic
● Keep action flows vertical and
clean
| OS Tips and Tricks
Coding
● Always comment complex or
unclear logic
● Keep action flows vertical and
clean
● Use static entities instead of
hard-coded values.
SearchEngines
| OS Tips and Tricks
Coding
● Always comment complex or
unclear logic
● Keep action flows vertical and
clean
● Use static entities instead of hard-
coded values.
● Encapsulate data formatting
using user actions
| OS Tips and Tricks
Coding
● Always comment complex or
unclear logic
● Keep action flows vertical and
clean
● Use static entities instead of hard-
coded values.
● Encapsulate data formatting using
user actions
● Reuse
■ logic by creating user actions
| OS Tips and Tricks
Performance
● JavaScript / CSS
■ Don’t have JS inside expressions,
better to move it to the screen
| OS Tips and Tricks
Performance
● JavaScript / CSS
■ Don’t have JS inside expressions,
better to move it to the screen
● Abuse of scope data / Ajax
■ Use refreshQuery to rerun previous
queries
| OS Tips and Tricks
Performance
● JavaScript / CSS
■ Don’t have JS inside expressions,
better to move it to the screen
● Abuse of scope data / Ajax
■ Use refreshQuery to rerun previous
queries
● Too many query calls in
preparation
■ Queries called inside a “foreach” in
the preparation or in expressions
inside table records
| OS Tips and Tricks
Entities (Datamodel)
● Aggregates
■ No SQL background knowledge required
■ Easy to create and maintain
■ SQL-dialect agnostic
■ Automatically optimised by platform
● Isolate large data types
● Indexes
| OS Tips and Tricks
Entities (Datamodel)
● SQL
■ Bulk operations (INSERT/UPDATE/DELETE)
■ Access to DBMS-specific features (rank, pivot leaf etc)
| OS Tips and Tricks
Caching
● Webblocks, queries and actions
■ Based on input parameters
● You can create a dummy input
parameter for cache invalidation
● Always keep business logic in mind
| OS Tips and Tricks
Code review
● Do a periodic code review
● You can always learn
● Also a good moment to ask, does the
architecture still fit?
● Use static code analysis tools
■ Example: Architecture Dashboard
■ It will always reveal improvement
■ Many improvement can be made in limited
time
| OS Tips and Tricks| OS Tips and Tricks
Processes Timers/BPT
| OS Tips and Tricks
Timers
● Single process run
● Set schedule
● Timers can’t use input
parameters
● Large batch processing
● Synchronisation patterns
BPT
● Align several operations
● Actions can run in parallel
● Manual actions can be
implemented
● Stop/Start on database events
● Wait activity
| OS Tips and Tricks
Timers:
● Timers should never
timeout
● Does not repeat work
● Ensures completeness
● Ensures data integrity
| OS Tips and Tricks
BPT - special cases
● Manage own reporting entities
■ Queries over process entities can be
slow
BPT - special cases
● Manage own reporting entities
■ Queries over process entities can be
slow
■ Create own entity
■ Update via callbacks
| OS Tips and Tricks
BPT - special cases
● Separate Process Logic from
Application Logic
■ Process and the application are
changing
■ Can lead to lock and time-outs
■ Move the attributes new entity in a one-
to-one relationship.
| OS Tips and Tricks
Combine timers with BPT
| OS Tips and Tricks
BPT light
● Light Processes are intended to be used for background processing
● Flow only contains 1 automatic activity
● Light BPT start on the creation of a database entity record
● 20 threads from the Light BPT
● Light Processes don’t create entries on BPT tables
| OS Tips and Tricks
| OS Tips and Tricks
Thank You!
@ inerik.brzozowski@valuga.
nl
/erik-brzozowski-
nl

OutSystems Tips and Tricks

  • 1.
    | OS Tipsand Tricks OutSystems Tips and Tricks Project DO's and DON'Ts, and what we can learn from comics
  • 2.
    | OS Tipsand Tricks| OS Tips and Tricks Erik Brzozowski Senior OutSystems Consultant| Valuga @ in erik.brzozowski@valuga.nl /erik-brzozowski-nl
  • 3.
    | OS Tipsand Tricks Main topics ● Project ● Architecture ● Coding ● Processes Timers/BPT
  • 4.
    | OS Tipsand Tricks| OS Tips and Tricks Project
  • 5.
    | OS Tipsand Tricks Ask why ● Know the ultimate Goal ■ Design Sprint ● Know the problem you are solving ● Try to talk to everyone ■ Product owner ■ Techlead ■ Architect ■ Developers (also from other teams) ■ Users
  • 6.
    | OS Tipsand Tricks Scary questions ● But is it possible? ● Will it work? ● Which option takes the least time? ● It’s only a temporary solution, it doesn't have to be pretty ■ Nothing so permanent as a temporary solution Come up with suggestions and solutions.
  • 7.
    | OS Tipsand Tricks Backlog management ● Does this user story fit in the ultimate goal ● Accept that some user stories will not be built ● If you can’t prioritize this is an indication that something is wrong ● Start with the most complex user stories ■ Bring the pain forward
  • 8.
    | OS Tipsand Tricks Match with existing architecture ● When you know the what ● When you know the next thing to build ● Recheck how this would fit in the current landscape
  • 9.
    | OS Tipsand Tricks| OS Tips and Tricks Architecture https://xkcd.com/1667/
  • 10.
    | OS Tipsand Tricks How to design ● Iterative process ■ Disclose ■ Organize ■ Assemble 3: Assemble 1: Disclose 2: Organize iteration
  • 11.
    | OS Tipsand Tricks Disclose ● User stories and roles ● Information architecture ● Integration technology ● UX expectations 3: Assemble 1: Disclose 2: Organize iteration
  • 12.
    | OS Tipsand Tricks Organize ● Group or split Business concepts ● Place on a canvas ● Possibly disclose more concepts 3: Assemble 1: Disclose 2: Organize iteration
  • 13.
    | OS Tipsand Tricks Assemble ● Match recommended patterns ● Abstract external systems ● Check the validation rules 3: Assemble 1: Disclose 2: Organize iteration
  • 14.
    | OS Tipsand Tricks No side references among orchestration or end-user modules ● No end-user screens ● Read only entities Assemble: Rule #1 layer modules (and applications) ● No business logic ● No core entities ● No role based logic Core Layer Core business services Library layer Non business services End User Layer User processes Orchestration Layer Cross application orchestration No upward references
  • 15.
    | OS Tipsand Tricks Rule #2 don’t mix owners Common application Module 1 Module 3Module 2 Application 1 Module 1 Module 2 Application 2 Module 3Split Who can make the call to go to production?
  • 16.
    | OS Tipsand Tricks Rule #3 don’t mix sponsors One big application for 3 divisions General core 1 General core 2 Core 1 Front end division 1 Core 1 Front end division 2 Core 1 Front end division 3 Application division 3 Application division 2 Application division 1 Common application Core 1 Core 2 Core 1 Front end division 1 Core 1 Front end division 2 Core 1 Front end division 3 Split
  • 17.
    | OS Tipsand Tricks Most architectures start easy What can go wrong? ● No time to refactor ● Architecture iterations stop ● No designs or documentation ● Team(members) change ● No patterns are used ● Violations are introduced
  • 18.
    | OS Tipsand Tricks| OS Tips and Tricks Coding
  • 19.
    | OS Tipsand Tricks Naming conventions ● Use meaningful names ● Use PascalCase ● Create folders for actions and for structures ● Avoid empty labels ● Suffix foreign keys with Id ● Always group screens by name ● Set the name property of TableRecords, ShowRecords and ListRecords
  • 20.
    | OS Tipsand Tricks Coding ● Always comment complex or unclear logic
  • 21.
    | OS Tipsand Tricks Coding ● Always comment complex or unclear logic ● Keep action flows vertical and clean
  • 22.
    | OS Tipsand Tricks Coding ● Always comment complex or unclear logic ● Keep action flows vertical and clean ● Use static entities instead of hard-coded values. SearchEngines
  • 23.
    | OS Tipsand Tricks Coding ● Always comment complex or unclear logic ● Keep action flows vertical and clean ● Use static entities instead of hard- coded values. ● Encapsulate data formatting using user actions
  • 24.
    | OS Tipsand Tricks Coding ● Always comment complex or unclear logic ● Keep action flows vertical and clean ● Use static entities instead of hard- coded values. ● Encapsulate data formatting using user actions ● Reuse ■ logic by creating user actions
  • 25.
    | OS Tipsand Tricks Performance ● JavaScript / CSS ■ Don’t have JS inside expressions, better to move it to the screen
  • 26.
    | OS Tipsand Tricks Performance ● JavaScript / CSS ■ Don’t have JS inside expressions, better to move it to the screen ● Abuse of scope data / Ajax ■ Use refreshQuery to rerun previous queries
  • 27.
    | OS Tipsand Tricks Performance ● JavaScript / CSS ■ Don’t have JS inside expressions, better to move it to the screen ● Abuse of scope data / Ajax ■ Use refreshQuery to rerun previous queries ● Too many query calls in preparation ■ Queries called inside a “foreach” in the preparation or in expressions inside table records
  • 28.
    | OS Tipsand Tricks Entities (Datamodel) ● Aggregates ■ No SQL background knowledge required ■ Easy to create and maintain ■ SQL-dialect agnostic ■ Automatically optimised by platform ● Isolate large data types ● Indexes
  • 29.
    | OS Tipsand Tricks Entities (Datamodel) ● SQL ■ Bulk operations (INSERT/UPDATE/DELETE) ■ Access to DBMS-specific features (rank, pivot leaf etc)
  • 30.
    | OS Tipsand Tricks Caching ● Webblocks, queries and actions ■ Based on input parameters ● You can create a dummy input parameter for cache invalidation ● Always keep business logic in mind
  • 31.
    | OS Tipsand Tricks Code review ● Do a periodic code review ● You can always learn ● Also a good moment to ask, does the architecture still fit? ● Use static code analysis tools ■ Example: Architecture Dashboard ■ It will always reveal improvement ■ Many improvement can be made in limited time
  • 32.
    | OS Tipsand Tricks| OS Tips and Tricks Processes Timers/BPT
  • 33.
    | OS Tipsand Tricks Timers ● Single process run ● Set schedule ● Timers can’t use input parameters ● Large batch processing ● Synchronisation patterns BPT ● Align several operations ● Actions can run in parallel ● Manual actions can be implemented ● Stop/Start on database events ● Wait activity
  • 34.
    | OS Tipsand Tricks Timers: ● Timers should never timeout ● Does not repeat work ● Ensures completeness ● Ensures data integrity
  • 35.
    | OS Tipsand Tricks BPT - special cases ● Manage own reporting entities ■ Queries over process entities can be slow BPT - special cases ● Manage own reporting entities ■ Queries over process entities can be slow ■ Create own entity ■ Update via callbacks
  • 36.
    | OS Tipsand Tricks BPT - special cases ● Separate Process Logic from Application Logic ■ Process and the application are changing ■ Can lead to lock and time-outs ■ Move the attributes new entity in a one- to-one relationship.
  • 37.
    | OS Tipsand Tricks Combine timers with BPT
  • 38.
    | OS Tipsand Tricks BPT light ● Light Processes are intended to be used for background processing ● Flow only contains 1 automatic activity ● Light BPT start on the creation of a database entity record ● 20 threads from the Light BPT ● Light Processes don’t create entries on BPT tables
  • 39.
    | OS Tipsand Tricks
  • 40.
    | OS Tipsand Tricks Thank You! @ inerik.brzozowski@valuga. nl /erik-brzozowski- nl

Editor's Notes

  • #3 introduction, background story, why connected to OutSystems.
  • #6 https://www.outsystems.com/-/media/A49C3F1FB3BC4280904093BB45B151DC.ashx 7 rules explained in a 20 minutes read. I will highlight one rule Rule 1: Ask Why Rule 2: The Small Crisis Rule 3: Challenge the Status Quo Rule 4: Be helpful Rule 5: 80/20 Rule 6: Communicate to be understood Rule 7: Excel 2:10 PM Harrald Spooren RADS - Rapid Application Design Sprint TECH II
  • #7 Challenge the proposed solutions -- > Examples where it is technically possible but you are fixing problems of other systems. You are adding legacy in you own application. This will cause problems in the future
  • #11 https://www.outsystems.com/learn/lesson/1220/the-architecture-design-process/?LearningPathId=8
  • #12 https://www.outsystems.com/learn/lesson/1220/the-architecture-design-process/?LearningPathId=8
  • #13 https://www.outsystems.com/learn/lesson/1220/the-architecture-design-process/?LearningPathId=8
  • #14 https://www.outsystems.com/learn/lesson/1220/the-architecture-design-process/?LearningPathId=8
  • #15 Copy/Paste can create unexpected references!
  • #16 https://www.slideshare.net/OutSystems/fitting-outsystems-applications-into-enterprise-architecture
  • #17 https://www.slideshare.net/OutSystems/fitting-outsystems-applications-into-enterprise-architecture
  • #18 Result: Poor service extractions Unmanageable dependencies Inflexible solutions Weak reference through web services, when transaction is not an issue Keep granularity when integrating with large APIs ... Split by functional groups
  • #26 Session Variables using large data types (Each web request loads session context which takes longer with large data types, causing contention in the session data model with the increase of concurrent users. This is even more important when you use AJAX, as that technology invariably increases the number of requests. )
  • #28 Session Variables using large data types (Each web request loads session context which takes longer with large data types, causing contention in the session data model with the increase of concurrent users. This is even more important when you use AJAX, as that technology invariably increases the number of requests. )
  • #29 https://success.outsystems.com/Documentation/Best_Practices/Performance_Best_Practices/Performance_Best_Practices_-_Queries
  • #30 https://success.outsystems.com/Documentation/Best_Practices/Performance_Best_Practices/Performance_Best_Practices_-_Queries
  • #31 Screens and Web Blocks can also be cached and it is usually better to cache at the boundaries of a “service” (on the UI, on the web service response) as databases already have excellent caching mechanisms and correct indexing is usually enough. But caching business logic and results rendering can give you that extra degree of performance. Just make sure the logic you’re caching is not designed to have external side effects (database changes etc). Cache screens and weblocks. Databases already have great caching mechanisms, so we do not need to worry about that much, in particular if we have a good indexing support. Caching business logic and results, in particular if you have kind of repetitive hits can be extremely helpful as well. Careful with the side effects, namely when it affects the database. https://success.outsystems.com/Documentation/Best_Practices/Performance_Best_Practices/Improving_performance_with_distributed_caching
  • #36 https://www.outsystems.com/learn/lesson/925/scale-queries-over-process-entities/?LearningPathId=0
  • #37 https://www.outsystems.com/learn/lesson/925/scale-queries-over-process-entities/?LearningPathId=0 https://www.outsystems.com/learn/lesson/926/separate-process-logic-from-application-logic/?LearningPathId=0
  • #38  Billing process flow requires polling an external system (for example, SAP) until a condition is satisfied; it can then be released and proceed its normal process flow. https://www.outsystems.com/learn/lesson/922/terminate-idle-processes/?LearningPathId=0
  • #39  https://www.outsystems.com/forums/discussion/41063/light-processes-under-the-hood/ 2:15 PM Miguel Melo Launching a BPT Process on Entity Update E1.03