Skip to content

Commit 63f2622

Browse files
Merge branch 'main' into remove-adaptTemplatesCobiGen
2 parents 932222e + ae4c58e commit 63f2622

32 files changed

Lines changed: 500 additions & 14 deletions

devon4j-app/index.asciidoc

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
====
33
devon4j is the Java stack of devonfw. It allows you to build business applications (backends) using Java technology in a highly efficient and standardized way based on established best-practices.
44
5-
## Prerequisites
5+
# Prerequisites
66
* User should have Java development experience
77
8-
## Learning goals
9-
After completing this scenario, you will have learned how to generate Java application using devon4j.
8+
# Learning goals
9+
* After completing this scenario, you will have learned how to generate Java application using devon4j.
1010
1111
More information about devon4j on https://devonfw.com/website/pages/docs/devon4j.asciidoc.html
1212
@@ -17,13 +17,18 @@ More information about devon4j on https://devonfw.com/website/pages/docs/devon4j
1717
restoreDevonfwIde (["java","mvn","vscode"])
1818
--
1919
====
20-
### Create devon4j sample application
20+
### A devon4j Sample Application
21+
22+
Note: Startup script will take some time for set up. After that you can proceed further.
2123

2224
If you want to create devon4j application on your local machine there are two ways to do it:
25+
2326
* In eclipse as shown [here](https://devonfw.com/website/pages/docs/devon4j.asciidoc_tutorials.html#tutorial-newapp.asciidoc_from-eclipse)
27+
2428
* Using command line as shown [here](https://devonfw.com/website/pages/docs/devon4j.asciidoc_tutorials.html#tutorial-newapp.asciidoc_from-command-line)
2529
26-
Now, we will create sample devon4j application with name *sampleapp*. This step will guide you on how to do it.
30+
Now, you will create sample devon4j application with name *sampleapp*. This step will guide you on how to do it.
31+
2732

2833
[step]
2934
--
@@ -32,27 +37,30 @@ createDevon4jProject("com.example.application.sampleapp")
3237

3338
Once sampleapp is created switch to next tab of IDE. In IDE explorer you can see folder structure like devonfw-> workspaces->main->sampleapp .
3439

35-
sampleapp contains 3 modules i.e api, core and server.
40+
Sampleapp contains 3 modules i.e api, core and server.
3641

3742
**api**: It contains API for sampleapp.The API contains the required artifacts to interact with your application via remote services. This can be REST service interfaces, transfer-objects with their interfaces and datatypes but also OpenAPI or gRPC contracts.
3843

3944
**core**: It is the core of the application.In this module you can write actual business logic with service implementation, as well as entire logic layer and dataaccess layer.
4045

41-
**batch**: optional module for batch layer. In this example we have not created it. To add batch module while generating from commandline use -Dbatch=batch parameter. And to generate it from eclipse using mave archetype enter batch variable value as batch in project creation page.
46+
**batch**: Optional module for batch layer. In this example we have not created it. To add batch module while generating from commandline use -Dbatch=batch parameter. And to generate it from eclipse using maven archetype, enter batch variable value as batch in project creation page.
4247

4348
**server**: This module bundles the entire app (core with optional batch) typically as a bootified WAR file.
4449

45-
If you want to know more about modules and project structure refer [here](https://github.com/devonfw/devon4j/blob/master/documentation/guide-structure.asciidoc#project-structure).
50+
If you want to know more about modules and project structure refer [here](#https://github.com/devonfw/devon4j/blob/master/documentation/guide-structure.asciidoc#project-structure).
4651
====
52+
53+
4754
====
4855
[step]
4956
--
5057
displayContent("devon4j multilayer architecture", [{ "image": "images/devon4j_proj_structure1.jpg" }])
5158
--
5259
53-
As shown in above image,devon4j application follows [multilayered architecture](https://en.wikipedia.org/wiki/Multitier_architecture).
60+
As shown in above image, devon4j application follows [multilayered architecture](https://en.wikipedia.org/wiki/Multitier_architecture).
5461
5562
Each component is divided into following layers:
63+
5664
* [client layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-client-layer.asciidoc) for the front-end (GUI).
5765
5866
* [service layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-service-layer.asciidoc) for the services used to expose functionality of the back-end to the client or other consumers. For example, in sampleapp we generated com.example.application.sampleapp.<componentname>.service.impl will have all rest service implementation.
@@ -61,12 +69,12 @@ Each component is divided into following layers:
6169
6270
* [logic layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-logic-layer.asciidoc) for the business logic. For example, in sampleapp we generated com.example.application.sampleapp.<componentname>.logic will contain business logic or usecase implementation.
6371
64-
* [data-access layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-dataaccess-layer.asciidoc) for the data access (esp. persistence).For example, in sampleapp we generated com.example.application.sampleapp.<compoenntname>.dataaccess will contain entity, repositories etc.
65-
====
72+
* [data-access layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-dataaccess-layer.asciidoc) for the data access (esp. persistence).For example, in sampleapp we generated com.example.application.sampleapp.<componentname>.dataaccess will contain entity, repositories etc.
6673
====
67-
### Build devon4j sample application
6874

69-
Build the java project
75+
76+
====
77+
Now you have to build a devon4j sample application i.e. sampleapp.
7078
7179
[step]
7280
--
@@ -76,14 +84,21 @@ buildJava("sampleapp", false)
7684
Once build is successful you will get bootified-war generated in server module target folder. In sampleapp check for path sampleapp/server/sampleapp-server-bootified.war
7785
7886
====
87+
88+
7989
====
8090
## Conclusion
8191
8292
In this tutorial you have learnt how to create devon4j application using command line or via Eclipse. Next you can check for other tutorials such as:
83-
* Java backend code generation using CobiGen (Code Generator)
93+
8494
* devon4j- contract first code generation
95+
8596
* devon4j-Kafka
97+
8698
* devon4j-security
99+
87100
* devon4j with Spring JPA
101+
88102
* devon4j rest services
103+
89104
====
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
import { FirstComponent } from './first/first/first.component';
4+
5+
const routes: Routes = [
6+
{
7+
path: 'first',
8+
component: FirstComponent
9+
},
10+
{
11+
path: '',
12+
redirectTo: 'first',
13+
pathMatch: 'full',
14+
},
15+
];
16+
17+
@NgModule({
18+
imports: [RouterModule.forRoot(routes)],
19+
exports: [RouterModule]
20+
})
21+
export class AppRoutingModule { }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
const routes: Routes = [
5+
{
6+
path: 'first',
7+
loadChildren: () => import('./first/first.module').then(m => m.FirstModule),
8+
},
9+
{
10+
path: '',
11+
redirectTo: 'first',
12+
pathMatch: 'full',
13+
},
14+
];
15+
16+
@NgModule({
17+
imports: [RouterModule.forRoot(routes)],
18+
exports: [RouterModule]
19+
})
20+
export class AppRoutingModule { }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<router-outlet></router-outlet>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
4+
import { AppRoutingModule } from './app-routing.module';
5+
import { AppComponent } from './app.component';
6+
import { FirstModule } from './first/first.module';
7+
8+
@NgModule({
9+
declarations: [
10+
AppComponent
11+
],
12+
imports: [
13+
BrowserModule,
14+
AppRoutingModule,
15+
FirstModule
16+
],
17+
providers: [],
18+
bootstrap: [AppComponent]
19+
})
20+
export class AppModule { }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
4+
import { AppRoutingModule } from './app-routing.module';
5+
import { AppComponent } from './app.component';
6+
7+
@NgModule({
8+
declarations: [
9+
AppComponent
10+
],
11+
imports: [
12+
BrowserModule,
13+
AppRoutingModule,
14+
],
15+
providers: [],
16+
bootstrap: [AppComponent]
17+
})
18+
export class AppModule { }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div style="text-align: center">
2+
<h1>Welcome to 2nd level module (right)</h1>
3+
<img
4+
width="300"
5+
alt="Angular Logo"
6+
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
7+
/>
8+
</div>
9+
<div style="display: flex; align-items: center; justify-content: center">
10+
<button routerLink="/first">Go back</button>
11+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div style="text-align:center">
2+
<h1>
3+
Welcome to 2nd level module (left)
4+
</h1>
5+
<img
6+
width="300"
7+
alt="Angular Logo"
8+
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
9+
/>
10+
</div>
11+
<div style="display: flex; align-items: center; justify-content: center">
12+
<button routerLink="/first">Go back</button>
13+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-content',
5+
templateUrl: './content.component.html',
6+
styleUrls: ['./content.component.scss']
7+
})
8+
export class ContentComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit(): void {
13+
}
14+
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)