SlideShare a Scribd company logo
1 of 30
Download to read offline
https://jhipster.tech @java_hipster
Custom and
Generated Code Side
by Side
@agoncal
https://jhipster.tech @java_hipster
https://jhipster.tech @java_hipster
Website
Call for
Paper
Scheduling Mobile App
Ticketing
Scanning
Digital
Signage
Tweet wallAccounting
Sponsor
Venue
3rd party
https://jhipster.tech @java_hipster
https://jhipster.tech @java_hipster
Website
Call for
Paper
Scheduling Mobile App
Ticketing
Scanning
Digital
Signage
Tweet wallAccounting
Sponsor
Venue
3rd party
Grew up organically
No communication
No SSO
No multitenancy
No container
Fed up of polyglot
https://jhipster.tech @java_hipster
https://jhipster.tech @java_hipster
Website
Call for
Paper
Scheduling Mobile App
Ticketing
Scanning
Digital
Signage
Tweet wallAccounting
Sponsor
Venue
3rd party
Deployer
https://jhipster.tech @java_hipster
Patterns We Used
Prototype Bootstrap Side by side
Quickly test
Throw away
https://jhipster.tech @java_hipster
Prototype
https://jhipster.tech @java_hipster
Prototype
JDL
https://jhipster.tech @java_hipster
Patterns We Used
Prototype Bootstrap Side by side
Quickly test
Throw away
Bootstrap code
Bootstrap model
Change the
generated code
https://jhipster.tech @java_hipster
Bootstrap
JDL
https://jhipster.tech @java_hipster
Patterns We Used
Prototype Bootstrap Side by side
Quickly test
Throw away
Bootstrap code
Bootstrap model
Change the
generated code
JDL centric
Regenerate code
frequently
Don’t change
generated code
Develop our own
code
https://jhipster.tech @java_hipster
Side by Side
JDL
https://jhipster.tech @java_hipster
Contact/Organisation JDL
entity Organisation (spn_organisation) {
name String required maxlength(NAME_MAX_LENGTH),
description String maxlength(DESCRIPTION_MAX_LENGTH),
businessIdentification String,
corporateName String,
}
entity Contact (spn_contact) {
firstName String required maxlength(NAME_MAX_LENGTH),
lastName String required maxlength(NAME_MAX_LENGTH),
email String required minlength(EMAIL_MIN_LENGTH) maxlength(EMAIL_MAX_LENGTH),
}
relationship OneToMany {
Organisation{contacts(lastName)} to Contact{organisation(name) required}
}
https://jhipster.tech @java_hipster
Contact/Organisation Code
organisation
.json
Domain
Contact
Organisation
1..*
Organisation
Repository
RepositoryService
Organisation
Service
REST
Organisation
Resource
Angular
Organisation
Service
Organisation
/api
Organisation
Component
Organisation
Repository
Extended
Organisation
Service
Extended
Organisation
Resource
Extended
Organisation
Service
Extended
/api/ext
Organisation
Component
Extended
organisation-
extended.json
https://jhipster.tech @java_hipster
Repository
@Repository
public interface OrganisationRepository extends JpaRepository<Organisation, Long>,
JpaSpecificationExecutor<Organisation> {
}
@Repository
public interface OrganisationRepositoryExtended extends OrganisationRepository {
@Query("select spn_organisation from Organisation spn_organisation left join fetch
spn_organisation.contacts where spn_organisation.id =:id")
Optional<Organisation> findOneWithEagerRelationships(@Param("id") Long id);
}
https://jhipster.tech @java_hipster
Service
@Service @Transactional
public class OrganisationService {
private final OrganisationRepository organisationRepository;
public OrganisationService(OrganisationRepository organisationRepository) {
this.organisationRepository = organisationRepository;
}
@Service @Transactional
public class OrganisationServiceExtended extends OrganisationService {
private final OrganisationRepositoryExtended organisationRepository;
public OrganisationServiceExtended(OrganisationRepositoryExtended organisationRepository) {
super(organisationRepository);
this.organisationRepository = organisationRepository;
}
https://jhipster.tech @java_hipster
Resource
@RestController
@RequestMapping("/api")
public class OrganisationResource {
private final OrganisationService organisationService;
@RestController
@RequestMapping("/api/extended")
public class OrganisationResourceExtended {
private final OrganisationServiceExtended organisationService;
https://jhipster.tech @java_hipster
Angular Service
@Injectable({ providedIn: 'root' })
export class OrganisationService {
private resourceUrl = SERVER_API_URL + 'api/organisations';
constructor(private http: HttpClient) {}
create(organisation: IOrganisation): Observable<EntityResponseType> { }
@Injectable({ providedIn: 'root' })
export class OrganisationExtendedService extends OrganisationService {
private resourceUrlExtended = SERVER_API_URL + 'api/extended/organisations';
constructor(private httpExt: HttpClient) {
super(httpExt);
}
https://jhipster.tech @java_hipster
Contact/Organisation Code
organisation
.json
Domain
Contact
Organisation
1..*
Organisation
Repository
RepositoryService
Organisation
Service
REST
Organisation
Resource
Angular
Organisation
Service
Organisation
/api
Organisation
Component
Organisation
Repository
Extended
Organisation
Service
Extended
Organisation
Resource
Extended
Organisation
Service
Extended
/api/ext
Organisation
Component
Extended
organisation-
extended.json
DTO
Mapper
Exception
https://jhipster.tech @java_hipster
First Sprints (development)
● Start with a monolith
● JWT
● Avoid liquibase changeset
● Liquibase context for dev data
● Use Query filters
● Our side-by-side code
○ Components
○ Repositories
○ Services
○ Endpoint
https://jhipster.tech @java_hipster
Later Sprints (production)
● Moved to microservices
● Keycloak
● Use liquibase changeset
● Add Gatling / Protractor
● Production in the cloud
https://jhipster.tech @java_hipster
Lessons Learnt
● Start will less tech/features, add them later
● Keep JDL up to date
● Never touch generated code
● Keep up with JHipster version
● Use DTO
● Use Query filters
● Run -Pprod builds from start
● Introduce new i18n when needed
● Use PrimeNG components
https://jhipster.tech @java_hipster
Lessons Learnt
● PostgreSQL is a fantastic DB (JSon, full text)
● Same DB in dev and prod
● Stick to JHipster
● Docker is good for dev (we don’t use it in prod)
● Reduce the number of technologies
○ Microservices are difficult enough
○ Each new service has a cost in the Cloud
https://jhipster.tech @java_hipster
What’s Missing?
● Better directory structure / naming convention
○ Using angularSuffix for now
● Richer model
○ One-to-many unidirectional, Embeddable, List<datatypes>
● More best practices
○ Exception handling in services, Async calls
● Flexible endpoints
○ /api, /internal, /public
● More PostgreSQL support
○ Full text search, JSON
https://jhipster.tech @java_hipster
What’s Missing?
● Generate more code with a richer JDL
○ Constants (ending up in Constants.java)
○ Enums (with no entity), helper classes...
○ Repository
○ Service
○ Endpoint
○ Angular services
https://jhipster.tech @java_hipster
Contributing back
● Full-text search with PostgreSQL
● Reference data
○ Country (iso2, iso3, name, dial, continent, flag, latitude, longitude, zoom)
○ Language (alpha3b, alpha2, name, flag32)
○ Currency (alphabeticCode, name, numericCode, minorUnit, symbol)
https://jhipster.tech @java_hipster
Website
Call for
Paper
Scheduling Mobile App
Ticketing
Scanning
Digital
Signage
Tweet wallAccounting
Sponsor
Venue
3rd party
Deployer
Road Map
https://jhipster.tech @java_hipster
Thanks
https://github.com/agoncal/agoncal-talks/tree/master/2018-06-JHipsterConf
@agoncal

More Related Content

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Custom and Generated Code Side by Side with JHipster