Comments (10)
Hey there @sdeleuze, I would really be happy to take charge of this issue, if you think that it is possible. I love the DSL, but the main issue that I see for a large adoption is exactly the lack of documentation (compared to regular Spring). Then it would be an honour for me to contribute to it. What do you think about it?
from spring-fu.
Also... springboot or springwebflux?
from spring-fu.
Ok perfect. I was thinking about proposing to substitute mustache with Kotlin HTML DSL, which is more idiomatic. But if the goal is to provide also JaFu examples... then I suppose that mustache is a better choice as well 😄
from spring-fu.
Hey, thanks for working on that, looks great. I will discuss with @poutsma what should be the next steps and let you know.
from spring-fu.
Hi, your help on this would be appreciated since indeed we really lack of documentation. Happy to provide support if needed. I would suggest to use JDBC instead of JPA as done in https://github.com/spring-projects-experimental/spring-fu/tree/main/samples/kofu-petclinic-jdbc for the Kofu version. Could you write it in Asciidoc?
We could add Jafu version in a second time.
from spring-fu.
Yes, I think that writing in Asciidoc is not a problem. But where should I provide the documentation? Maybe a PR on this project with a new folder tutorial
containing the new doc?
JDBC is ok for me... but why not Exposed? It is more Kotlin oriented. Anyway, also JDBC is fine.
Would you suggest starting with the Spring initializer even if there is no template for the functional main
? Or maybe I could just go enumerating the maven dependencies?
from spring-fu.
Maybe a PR on this project with a new folder tutorial containing the new doc?
A PR on this project is fine yeah.
JDBC is ok for me... but why not Exposed? It is more Kotlin oriented. Anyway, also JDBC is fine.
The goal is to be able to provide both KoFu and JaFu samples so sticking to JDBC seems a better choice for that purpose.
Would you suggest starting with the Spring initializer even if there is no template for the functional main? Or maybe I could just go enumerating the maven dependencies?
Yes starting from start.spring.io and replacing the main function is probably the best way.
Also... springboot or springwebflux?
I assume you mean Spring MVC or Spring WebFlux. Let's use Spring MVC to target a wider audience and be consistent with JDBC blocking persistence.
from spring-fu.
Hi @sdeleuze, it took a while but I finally started on this task! I suppose no one did it yet, as the issue is still open.
Before writing the tutorial, I started implementing the example code.
Would you mind giving me some feedback? Here is the repository https://github.com/lucapiccinelli/spring-kofu-tutorial-draft.
I implemented:
- some tests on the first route BlogTests.kt (similar to sections "Writing your first Kotlin controller" and "Writing your first Kotlin controller" of https://spring.io/guides/tutorials/spring-boot-kotlin/)
- user and article repositories/entities and related tests. Please, see
- the tests: RepositoriesTests.kt
- a related helper: JdbcTestsHelper.kt
- the repositories itself: JdbcUserRepositoryImpl.kt and JdbcArticleRepositoryImpl.kt
I'm not a fan of JPA, but it is objective that when choosing not to use it, you lose some interesting features, like lazy fetching. Then I thought of giving a suggestion of how to implement it using lazy Kotlin delegate. Please have a look at this and this.
Also, I used sealed classes to model if a (domain) Entity needs to be inserted or updated. Have a look here and here
Please tell me if this is ok for you or it is too much for a tutorial. If you mind about Java examples, sealed classes semantics can be reproduced using a Visitor pattern. The lazy operator could just be avoided in Java examples.
If my approach is ok for you, I will continue with the rest of the examples. I can also have a step back and void using sealed classes and lazy delegate.
Thank you!
from spring-fu.
Hello @sdeleuze, I started writing the tutorial here https://github.com/lucapiccinelli/spring-fu/tree/kofu-tutorial/samples/kofu-tutorial. As an introduction, I copy/pasted your README of KoFu. I think it is good to introduce what we are talking about.
When you have time, please tell me your thought about it. Especially about Content of this tutorial.
Have a nice day!
from spring-fu.
The tutorial is done. I will proceed with a pull request, so that you can review it. I did the homework...but please verify that what I wrote is correct.
from spring-fu.
Related Issues (20)
- Upgrade to Spring Boot 2.4.4
- Rename master `branch` to `main`
- Upgrade to Spring Boot 2.5.1
- Ability to create endpoints/routes dynamically (IE and endpoint creating another endpoint at runtime)?
- enable function is protected HOT 1
- spring-boot-autoconfigure conflit HOT 1
- Cannot extend Kotlin DSL HOT 1
- Upgrade to Spring Boot 2.5.3
- CoroutineCrudRepository issue
- Spring Native compatibility HOT 1
- Is the project discontinued? HOT 4
- [question] is Spring Fu production ready? HOT 1
- Upgrade to Spring Boot 2.6
- Build uses jcenter() which is deprecated and will be removed in Gradle 8
- Spring Kofu 0.5.0 issue with Spring Native HOT 1
- Project timeline HOT 2
- Upgrade to Spring Boot 2.6.6
- R2dbc H2 does not work with Spring Boot 2.7 HOT 1
- Activate Autoconfiguration for certain external dependencies HOT 1
- Spring Boot 3.0.0 seems to break kofu HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-fu.