SlideShare a Scribd company logo
1 of 24
| Building CRUD Wrappers
Building CRUD Wrappers
| Building CRUD Wrappers| Building CRUD Wrappers
Justin
James
Chief Architect | Cloud Development Resources
@
in
justin.james@clouddevelopmentresources.com
/jmjames
| Building CRUD Wrappers| Building CRUD Wrappers
Before we start...
| Building CRUD Wrappers
There Are No Few “Architecture Laws”
● I do not know it all
● There will be times to not follow these guidelines
● This is constantly changing, evolving, and shifting as I learn new things
and experience new projects and address pain points
● HOWEVER… this is based on 10 years of OutSystems experience and
has covered virtually every project I have done
● If unsure… ASK!
| Building CRUD Wrappers| Building CRUD Wrappers
OK, let’s jump in!
| Building CRUD Wrappers
CRUD Wrappers?
● CRUD Wrappers replace the
“CreateX”, “CreateOrDeleteX”,
“UpdateX”, “DeleteX” Actions in
your projects
● They enforce business logic
● Central place for messages
and validation
● Reside in the Core Layer of
4LC
| Building CRUD Wrappers
OK, but WHY?
● Separation of concerns (4LC)
● Makes localization much
easier to have so much of the
important text in one location
● Easy to have auditing and
security
● Can easily build APIs by
putting Web Services in front
of them
| Building CRUD Wrappers| Building CRUD Wrappers
Basic setup...
| Building CRUD Wrappers
Typical Exceptions
● ProcessingException
● ValidationException
● NotImplementedException
| Building CRUD Wrappers
Standard Structures:
● Message
■ MessageTypeId (from
RichWidgets)
■ MessageText (text)
● EntityActionResult
■ Messages (list of Message)
■ CombinedMessageTypeId
(MessageTypeId)
■ CombinedMessageText (text)
■ IsSuccess (Boolean)
| Building CRUD Wrappers
Standard Actions - Session_GetNormalizedSessionUserId():
● Returns the current User Id if it is not null
● Returns the Configuration_GetAnonymousUserId otherwise
● This allows us to always have a valid User Id for places where we
have a mandatory field for “who did this?” (CreatedOn, auditing,
logging, etc.) even when running as a Process, Timer, etc.
| Building CRUD Wrappers
Standard Actions - EntityActionResult_CombineMessages:
● Inputs a list of Messages
● Outputs the most severe MessageTypeId and the MessageText
values nicely put into one string
| Building CRUD Wrappers
Standard Actions - EntityActionResult_GenerateFromSuccess/Failure:
● Accepts a single text input
● Returns an EntityActionResult
● Sets IsSuccess
● Creates a single Message, adds it to Messages, sets the
CombinedMessageTypeId and CombinedMessageText
● Most frequently used way of getting an EntityActionResult
| Building CRUD Wrappers| Building CRUD Wrappers
Yikes… we’re here… no
more dilly dallying...
| Building CRUD Wrappers
X_GetCanRemove()
● Verifies if a record may be removed
● Function = YES
● Input parameter: Id, of type X Identifier
● Checks if the record exists and is not soft deleted already
● Checks if all child records can be removed, if removing the parent
would cause the children to be removed
● We should almost always keep the delete constraints to “Protect”
● Returns an EntityActionResult
| Building CRUD Wrappers
X_Remove()
● Function = YES
● Input parameter: Id, of type X Identifier
● Always starts with a call to X_GetCanRemove, throws a
ValidationException
● First removes any children (if that is the logic… it usually is not)
● For a hard delete, just calls DeleteX
| Building CRUD Wrappers
X_Remove() (Continued)
● For a soft delete:
■ Call GetXForUpdate
■ Set IsActive, UpdatedOn, UpdatedByUserId
■ Calls UpdateX
● Generate the EntityActionResult with a standard message that
includes the record’s name if possible (“Invoice “”” +
GetInvoiceForUpdate.Record.Name + “”” has been removed.”)
● Exception Handler: EntityActionResult_GenerateFromFailure
| Building CRUD Wrappers
X_Upsert()
● Function = NO
● Input parameter: Source, of type X
● Output parameters: Id (of type X Identifier), EntityActionResult
● Performs any validation, throws a ValidationException if it fails
● Sets any default values
● Branches on Source.Id = NullIdentifier or Source.CreatedOn and
Source.CreatedByUserId = null (Source is an extension Entity)
| Building CRUD Wrappers
X_Upsert() (Create Branch)
● Sets CreatedOn = CurrDateTime()
● Sets CreatedByUserId = Session_GetNormalizedUserId()
● Sets UpdatedOn = Source.Created on (guarantees they are the
same)
● Sets UpdatedByUserId = Source.CreatedByUserId (faster)
● Sets IsActive = True (no one should ever use this to create a deleted
record, prevents screens making deleted records)
● Calls CreateX
● Sets Id = CreateX.Id
| Building CRUD Wrappers
X_Upsert() (Update Branch)
● Sets UpdatedOn = CurrDateTime()
● Sets updatedByUserId = Session_GetNormalizedUserId()
● Calls UpdateX
● Sets Id = Source.Id
| Building CRUD Wrappers
X_Upsert() (Final Pieces)
● Branches merge again
● Perform any “clean up” logic, like updating child records or related
records
● Generate the EntityActionResult with a standard message that
includes the record’s name if possible (“Invoice “”” + Source.Name +
“”” has been saved.”)
● Exception Handler: EntityActionResult_GenerateFromFailure
| Building CRUD Wrappers| Building CRUD Wrappers
Whew! We made it! Time
to use them!
| Building CRUD Wrappers
All ya gotta do:
● Make sure that you check the
.IsSuccess of Remove and
Upsert
● Use the
CombinedMessageText/Type
to message
● Wrap Delete/Remove buttons
with X_GetCanRemove()
● Find/Replace perfectly
updates
| Building CRUD Wrappers
Thank You!
@ injustin.james@cloudd
evelopmentresource
s.com
/jmjames

More Related Content

What's hot

Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with JavascriptRitaDias72
 
BPM Patterns & Best Practices with OutSystems BPT
BPM Patterns & Best Practices with OutSystems BPTBPM Patterns & Best Practices with OutSystems BPT
BPM Patterns & Best Practices with OutSystems BPTGonçalo Borrêga
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsOutSystems
 
OutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideOutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideDaniel Reis
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems InstallationOutSystems
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365OutSystems
 
Testing With OutSystems
Testing With OutSystemsTesting With OutSystems
Testing With OutSystemsOutSystems
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckFábio Godinho
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesOutSystems
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksOutSystems
 
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A... OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...OutSystemsNeo
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best PracticesOutSystems
 
Clean low-code - OutSystens
Clean low-code - OutSystensClean low-code - OutSystens
Clean low-code - OutSystensHasan Derawan
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10OutSystems
 
0 to 60 With Outsystems
0 to 60 With Outsystems0 to 60 With Outsystems
0 to 60 With OutsystemsOutSystems
 
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...OutSystemsNeo
 
Hands-On With Reactive Web Design
Hands-On With Reactive Web DesignHands-On With Reactive Web Design
Hands-On With Reactive Web DesignOutSystems
 
Multi tenancy - a practical approach
Multi tenancy - a practical approachMulti tenancy - a practical approach
Multi tenancy - a practical approachCatarinaPereira64715
 
Sync or swim: the challenge of complex offline apps
Sync or swim:  the challenge of complex offline appsSync or swim:  the challenge of complex offline apps
Sync or swim: the challenge of complex offline appsOutSystems
 

What's hot (20)

Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with Javascript
 
BPM Patterns & Best Practices with OutSystems BPT
BPM Patterns & Best Practices with OutSystems BPTBPM Patterns & Best Practices with OutSystems BPT
BPM Patterns & Best Practices with OutSystems BPT
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystems
 
OutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideOutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style Guide
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365
 
Testing With OutSystems
Testing With OutSystemsTesting With OutSystems
Testing With OutSystems
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help Deck
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous Tasks
 
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A... OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
Clean low-code - OutSystens
Clean low-code - OutSystensClean low-code - OutSystens
Clean low-code - OutSystens
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10
 
0 to 60 With Outsystems
0 to 60 With Outsystems0 to 60 With Outsystems
0 to 60 With Outsystems
 
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
 
Hands-On With Reactive Web Design
Hands-On With Reactive Web DesignHands-On With Reactive Web Design
Hands-On With Reactive Web Design
 
OutSystems Platform Troubleshooting
OutSystems Platform TroubleshootingOutSystems Platform Troubleshooting
OutSystems Platform Troubleshooting
 
Multi tenancy - a practical approach
Multi tenancy - a practical approachMulti tenancy - a practical approach
Multi tenancy - a practical approach
 
Sync or swim: the challenge of complex offline apps
Sync or swim:  the challenge of complex offline appsSync or swim:  the challenge of complex offline apps
Sync or swim: the challenge of complex offline apps
 

Similar to Building CRUD Wrappers

Evolving a Clean, Pragmatic Architecture at JBCNConf 2019
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Evolving a Clean, Pragmatic Architecture at JBCNConf 2019
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Victor Rentea
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksStoyan Nikolov
 
Developer Test - Things to Know
Developer Test - Things to KnowDeveloper Test - Things to Know
Developer Test - Things to Knowvilniusjug
 
Design | expose ap is with cqr
Design | expose ap is with cqrDesign | expose ap is with cqr
Design | expose ap is with cqrJabar Asadi
 
Design | expose ap is with cqrs
Design | expose ap is with cqrsDesign | expose ap is with cqrs
Design | expose ap is with cqrselazhiA
 
Angular JS2 Training Session #1
Angular JS2 Training Session #1Angular JS2 Training Session #1
Angular JS2 Training Session #1Paras Mendiratta
 
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...Grokking VN
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rockmartincronje
 
Unit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and HowsUnit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and Howsatesgoral
 
Continous Integration of (JS) projects & check-build philosophy
Continous Integration of (JS) projects & check-build philosophyContinous Integration of (JS) projects & check-build philosophy
Continous Integration of (JS) projects & check-build philosophyFrançois-Guillaume Ribreau
 
Building Services With gRPC, Docker and Go
Building Services With gRPC, Docker and GoBuilding Services With gRPC, Docker and Go
Building Services With gRPC, Docker and GoMartin Kess
 
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017Ortus Solutions, Corp
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinSigma Software
 
Five android architecture
Five android architectureFive android architecture
Five android architectureTomislav Homan
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignŽilvinas Kuusas
 

Similar to Building CRUD Wrappers (20)

Evolving a Clean, Pragmatic Architecture at JBCNConf 2019
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Evolving a Clean, Pragmatic Architecture at JBCNConf 2019
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time Checks
 
Developer Test - Things to Know
Developer Test - Things to KnowDeveloper Test - Things to Know
Developer Test - Things to Know
 
Design | expose ap is with cqr
Design | expose ap is with cqrDesign | expose ap is with cqr
Design | expose ap is with cqr
 
Design | expose ap is with cqrs
Design | expose ap is with cqrsDesign | expose ap is with cqrs
Design | expose ap is with cqrs
 
Day 1
Day 1Day 1
Day 1
 
Coding Naked 2023
Coding Naked 2023Coding Naked 2023
Coding Naked 2023
 
Pyramid of-developer-skills
Pyramid of-developer-skillsPyramid of-developer-skills
Pyramid of-developer-skills
 
Angular JS2 Training Session #1
Angular JS2 Training Session #1Angular JS2 Training Session #1
Angular JS2 Training Session #1
 
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...
Grokking TechTalk #24: Thiết kế hệ thống Background Job Queue bằng Ruby & Pos...
 
UNIT 1 (7).pptx
UNIT 1 (7).pptxUNIT 1 (7).pptx
UNIT 1 (7).pptx
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rock
 
Unit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and HowsUnit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and Hows
 
Clean Code 2
Clean Code 2Clean Code 2
Clean Code 2
 
Continous Integration of (JS) projects & check-build philosophy
Continous Integration of (JS) projects & check-build philosophyContinous Integration of (JS) projects & check-build philosophy
Continous Integration of (JS) projects & check-build philosophy
 
Building Services With gRPC, Docker and Go
Building Services With gRPC, Docker and GoBuilding Services With gRPC, Docker and Go
Building Services With gRPC, Docker and Go
 
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
Five android architecture
Five android architectureFive android architecture
Five android architecture
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven Design
 

More from OutSystems

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaOutSystems
 
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyOutSystems
 
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...OutSystems
 
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutOutSystems
 
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...OutSystems
 
Fast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationOutSystems
 
Enrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersOutSystems
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensOutSystems
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseOutSystems
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintOutSystems
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic InnovationOutSystems
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceOutSystems
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...OutSystems
 
Neo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectNeo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectOutSystems
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsOutSystems
 
Link Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksLink Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksOutSystems
 
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentSetting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentOutSystems
 
Intro to the Data Grid
Intro to the Data GridIntro to the Data Grid
Intro to the Data GridOutSystems
 
How to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsHow to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsOutSystems
 

More from OutSystems (19)

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
 
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
 
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
 
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
 
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
 
Fast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical Application
 
Enrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With Layers
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class Citizens
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design Sprint
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic Innovation
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard Performance
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
 
Neo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectNeo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems Architect
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile Applications
 
Link Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksLink Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With Deeplinks
 
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentSetting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
 
Intro to the Data Grid
Intro to the Data GridIntro to the Data Grid
Intro to the Data Grid
 
How to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsHow to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive Markets
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 

Building CRUD Wrappers

  • 1. | Building CRUD Wrappers Building CRUD Wrappers
  • 2. | Building CRUD Wrappers| Building CRUD Wrappers Justin James Chief Architect | Cloud Development Resources @ in justin.james@clouddevelopmentresources.com /jmjames
  • 3. | Building CRUD Wrappers| Building CRUD Wrappers Before we start...
  • 4. | Building CRUD Wrappers There Are No Few “Architecture Laws” ● I do not know it all ● There will be times to not follow these guidelines ● This is constantly changing, evolving, and shifting as I learn new things and experience new projects and address pain points ● HOWEVER… this is based on 10 years of OutSystems experience and has covered virtually every project I have done ● If unsure… ASK!
  • 5. | Building CRUD Wrappers| Building CRUD Wrappers OK, let’s jump in!
  • 6. | Building CRUD Wrappers CRUD Wrappers? ● CRUD Wrappers replace the “CreateX”, “CreateOrDeleteX”, “UpdateX”, “DeleteX” Actions in your projects ● They enforce business logic ● Central place for messages and validation ● Reside in the Core Layer of 4LC
  • 7. | Building CRUD Wrappers OK, but WHY? ● Separation of concerns (4LC) ● Makes localization much easier to have so much of the important text in one location ● Easy to have auditing and security ● Can easily build APIs by putting Web Services in front of them
  • 8. | Building CRUD Wrappers| Building CRUD Wrappers Basic setup...
  • 9. | Building CRUD Wrappers Typical Exceptions ● ProcessingException ● ValidationException ● NotImplementedException
  • 10. | Building CRUD Wrappers Standard Structures: ● Message ■ MessageTypeId (from RichWidgets) ■ MessageText (text) ● EntityActionResult ■ Messages (list of Message) ■ CombinedMessageTypeId (MessageTypeId) ■ CombinedMessageText (text) ■ IsSuccess (Boolean)
  • 11. | Building CRUD Wrappers Standard Actions - Session_GetNormalizedSessionUserId(): ● Returns the current User Id if it is not null ● Returns the Configuration_GetAnonymousUserId otherwise ● This allows us to always have a valid User Id for places where we have a mandatory field for “who did this?” (CreatedOn, auditing, logging, etc.) even when running as a Process, Timer, etc.
  • 12. | Building CRUD Wrappers Standard Actions - EntityActionResult_CombineMessages: ● Inputs a list of Messages ● Outputs the most severe MessageTypeId and the MessageText values nicely put into one string
  • 13. | Building CRUD Wrappers Standard Actions - EntityActionResult_GenerateFromSuccess/Failure: ● Accepts a single text input ● Returns an EntityActionResult ● Sets IsSuccess ● Creates a single Message, adds it to Messages, sets the CombinedMessageTypeId and CombinedMessageText ● Most frequently used way of getting an EntityActionResult
  • 14. | Building CRUD Wrappers| Building CRUD Wrappers Yikes… we’re here… no more dilly dallying...
  • 15. | Building CRUD Wrappers X_GetCanRemove() ● Verifies if a record may be removed ● Function = YES ● Input parameter: Id, of type X Identifier ● Checks if the record exists and is not soft deleted already ● Checks if all child records can be removed, if removing the parent would cause the children to be removed ● We should almost always keep the delete constraints to “Protect” ● Returns an EntityActionResult
  • 16. | Building CRUD Wrappers X_Remove() ● Function = YES ● Input parameter: Id, of type X Identifier ● Always starts with a call to X_GetCanRemove, throws a ValidationException ● First removes any children (if that is the logic… it usually is not) ● For a hard delete, just calls DeleteX
  • 17. | Building CRUD Wrappers X_Remove() (Continued) ● For a soft delete: ■ Call GetXForUpdate ■ Set IsActive, UpdatedOn, UpdatedByUserId ■ Calls UpdateX ● Generate the EntityActionResult with a standard message that includes the record’s name if possible (“Invoice “”” + GetInvoiceForUpdate.Record.Name + “”” has been removed.”) ● Exception Handler: EntityActionResult_GenerateFromFailure
  • 18. | Building CRUD Wrappers X_Upsert() ● Function = NO ● Input parameter: Source, of type X ● Output parameters: Id (of type X Identifier), EntityActionResult ● Performs any validation, throws a ValidationException if it fails ● Sets any default values ● Branches on Source.Id = NullIdentifier or Source.CreatedOn and Source.CreatedByUserId = null (Source is an extension Entity)
  • 19. | Building CRUD Wrappers X_Upsert() (Create Branch) ● Sets CreatedOn = CurrDateTime() ● Sets CreatedByUserId = Session_GetNormalizedUserId() ● Sets UpdatedOn = Source.Created on (guarantees they are the same) ● Sets UpdatedByUserId = Source.CreatedByUserId (faster) ● Sets IsActive = True (no one should ever use this to create a deleted record, prevents screens making deleted records) ● Calls CreateX ● Sets Id = CreateX.Id
  • 20. | Building CRUD Wrappers X_Upsert() (Update Branch) ● Sets UpdatedOn = CurrDateTime() ● Sets updatedByUserId = Session_GetNormalizedUserId() ● Calls UpdateX ● Sets Id = Source.Id
  • 21. | Building CRUD Wrappers X_Upsert() (Final Pieces) ● Branches merge again ● Perform any “clean up” logic, like updating child records or related records ● Generate the EntityActionResult with a standard message that includes the record’s name if possible (“Invoice “”” + Source.Name + “”” has been saved.”) ● Exception Handler: EntityActionResult_GenerateFromFailure
  • 22. | Building CRUD Wrappers| Building CRUD Wrappers Whew! We made it! Time to use them!
  • 23. | Building CRUD Wrappers All ya gotta do: ● Make sure that you check the .IsSuccess of Remove and Upsert ● Use the CombinedMessageText/Type to message ● Wrap Delete/Remove buttons with X_GetCanRemove() ● Find/Replace perfectly updates
  • 24. | Building CRUD Wrappers Thank You! @ injustin.james@cloudd evelopmentresource s.com /jmjames