13. 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
17. 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);
}
18. 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;
}
24. 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
25. 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
26. 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
27. 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
28. 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)