You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,12 +101,12 @@ While the Dependency Injection (DI) itself is not hard to understand, it comes w
101
101
practice in larger project, it is overkill for simple projects. And you can have Services without DI.
102
102
- The DI requires you to run on a DI container, such as a JavaEE server, or with tons of Spring libraries. While that's nothing
103
103
new for a seasoned Java developer, this is overwhelming for a newbie which is just starting with the web app development.
104
-
- DI doesn't scale: It quickly tends to get very complex as the DI configuration grows.
104
+
Also, with the advent of Docker, we believe the time of Java servers such as JavaEE and Spring is over.
105
+
- DI doesn't scale: It quickly tends to get very complex as the DI configuration grows. DI is not something that
106
+
you'll need in the future anyway as your project grows: on the contrary, it adds additional layer of complexity.
105
107
- DI doesn't work well with Vaadin: injecting services into Vaadin components forces you to turn Vaadin
106
108
components themselves into beans, which is not compatible with the Vaadin framework. It's far
107
109
better to create a repository of services (one class which gives access to all services).
108
-
- DI is not something that you'll need in the future anyway as your project grows: on the contrary,
109
-
it adds additional layer of complexity.
110
110
- We consider DI an anti-pattern. We replace it with Kotlin built-in language features.
111
111
112
112
Therefore, VoK itself is not using DI; you can of course use Spring or JavaEE in your project alongside VoK if necessary.
@@ -183,18 +183,18 @@ folders:
183
183
184
184
## Hello, Vaadin-on-Kotlin!
185
185
186
-
To begin with, let's get some text up on screen quickly. To do this, you need to get a web server running.
186
+
To begin with, let's get some text up on screen quickly. To do this, let's get the app running.
187
187
188
188
### Starting up the Web Server
189
189
190
-
You actually have a functional VoK application already. To see it, you need to start a web server on your development machine.
190
+
You actually have a functional VoK application already. To see it, you need to start the app on your development machine.
191
191
You can do this by running the following in the `vok-helloworld-app` directory:
192
192
193
193
```bash
194
-
$ ./gradlew clean web:appRun
194
+
$ ./gradlew clean run
195
195
```
196
196
197
-
This will fire up Jetty, an embeddable Java web server. To see your application in action, open a browser window and navigate
197
+
This will fire up Jetty, an embedded Java web server. To see your application in action, open a browser window and navigate
198
198
to [http://localhost:8080](http://localhost:8080). You should see the Vaadin-on-Kotlin default information page:
199
199
200
200
<hr>
@@ -206,8 +206,8 @@ to [http://localhost:8080](http://localhost:8080). You should see the Vaadin-on-
206
206
> **Note:** To stop the web server, hit Ctrl+C in the terminal window where it's running. To verify the server has stopped
207
207
> you should see your command prompt cursor again. For most UNIX-like systems including macOS this will be a dollar sign $.
208
208
209
-
> **Note:** Changes made in your Kotlin files will be propagated to the running server only after you compile them, by
210
-
> running `./gradlew build`.
209
+
> **Note:** Changes made to your Kotlin files will not be propagated to the running server in this mode. However,
210
+
> we'll learn how to run the app from Intellij, for a proper full-blown developer environment.
211
211
212
212
The "Welcome aboard" page is the smoke test for a new VoK application: it makes sure that you
213
213
have your software configured correctly enough to serve a page.
@@ -216,15 +216,15 @@ have your software configured correctly enough to serve a page.
216
216
217
217
To get VoK saying "Hello", you need to create a route.
218
218
219
-
A route's purpose is to provide a Vaadin Component (usually a layout containing other components), which then interacts with the user.
219
+
The purpose of a route is to provide a Vaadin Component (usually a layout containing other components), which then interacts with the user.
220
220
The Route Registry decides which view receives which requests. Usually there is exactly one route to a view. You can collect the data
221
221
to be displayed right in the view itself (for small applications), or you can define so-called Service layer
222
222
(a group of regular Kotlin classes which define a clear API and are responsible for fetching of the data).
223
223
VoK however does not enforce this, and we will not use this pattern in the tutorial.
224
224
225
225
All Vaadin Components have two parts:
226
226
227
-
- Their JavaScript-based client side Web Component which you usually can not use directly;
227
+
- Their JavaScript-based client side Web Component which you usually can not control directly from your program;
228
228
- A server side class which you access from your code.
229
229
230
230
For example, a Button Web Component ([`vaadin-button`](https://vaadin.com/components/vaadin-button)) contains the logic to send the notification about the mouse click
0 commit comments