Skip to content

Commit

Permalink
#9 #11 #12 doc updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jveverka committed May 16, 2020
1 parent 0d71a5c commit 8e98174
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ mvn clean install
Open project in [IntelliJ IDEA](docs/ide-instructions.md).

### Examples and Lessons
1. [__java tips__](docs/JAVA-TIPS.md) - documentation project with basic java tips.
2. [__simple-project__](simple-project) - very simple maven java project.
3. [__lambda expressions__](lambdas) - lambda expression examples.
4. [__mt-demo__](mt-demo) - multi-threading demo.
5. [__annotations-demo__](annotations-demo) - annotation demo.
6. [__java-beans-demo__](java-bean-demo) - JSON serialization and deserialization of java beans.
7. [__service-demo__](service-demo) - simple data store service.
8. [__dependency-injection__](dependency-injection) - simple reflection based DI framework.
1. [__java tips__](docs/JAVA-TIPS.md) - an introduction to java ecosystem.
2. [__programming tips__](docs/JAVA-Programming.md) - tips for better code quality.
3. [__simple-project__](simple-project) - very simple maven java project.
4. [__lambda expressions__](lambdas) - lambda expression examples.
5. [__mt-demo__](mt-demo) - multi-threading demo.
6. [__annotations-demo__](annotations-demo) - annotation demo.
7. [__java-beans-demo__](java-bean-demo) - JSON serialization and deserialization of java beans.
8. [__service-demo__](service-demo) - simple data store service.
9. [__dependency-injection__](dependency-injection) - simple reflection based DI framework.

### Related Topics
* [__Understanding JVM__](https://dzone.com/articles/understanding-jvm-internals) - Java Virtual Machine Internals explained.
Expand Down
17 changes: 17 additions & 0 deletions docs/JAVA-Programming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Guide to effective java programming

## Always use java packages
Your project should have proper [java package](https://en.wikipedia.org/wiki/Java_package) structure from day 1.
A Java package organizes Java classes into namespaces providing a unique namespace for each type it contains.

## Always use logger
Always use [logger](https://www.vogella.com/tutorials/Logging/article.html).
Don't use ``System.out.println("my log statement")`` for logging in yor code !

## Create JUnit tests
From day 1, test your code ! Write code to be testable automatically !
Use [JUnit](https://junit.org/junit5/docs/current/user-guide/) to create automated tests.

## Use Static Code analyzer
Many IDEs have possibility ro use static code analysis to prevent bugs.
[Sonar Lint](https://www.sonarlint.org/) recommended. It is available as plugin for Intellij IDEA and Eclipse.
15 changes: 6 additions & 9 deletions docs/JAVA-TIPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ Always use [maven](https://maven.apache.org/download.cgi) or [gradle](https://gr
Do not use projects created by your IDE, because different IDEs may be used on same project !
This guide is designed for maven, but same principles apply for gradle build tool as well.

#### Use proper groupName, artefactId and version
Build result of java project is artefact - [jar](https://en.wikipedia.org/wiki/JAR_(file_format)), [war](https://en.wikipedia.org/wiki/WAR_(file_format)), or zip file.
Always use [proper artefact naming](http://maven.apache.org/guides/mini/guide-naming-conventions.html) for your project atefacts.
Use [semantic versioning](https://semver.org/) for you projects.

#### Project directory structure
It is very important to follow [java/maven project directory structure](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) conventions.
Maven directory structure is used also in gradle projects as default.

#### Build project
You should be able to build your project using ``mvn clean install`` command.

## Always use logger
Always use [logger](https://www.vogella.com/tutorials/Logging/article.html).
Don't use ``System.out.println("my log statement")`` for logging in yor code !
You should be able to build your project using ``mvn clean install`` command or ``gradle clean build`` command.

## Check your dependencies
Use well known public maven repositories to check your project dependencies.
Expand All @@ -44,9 +45,6 @@ Use well known public maven repositories to check your project dependencies.

Use up-to date dependencies. Maven command ``mvn dependency:tree -Dverbose``

## Create JUnit tests
Use [JUnit](https://junit.org/junit4/) to create automated tests.

## Recommended Java projects and libraries
When you are looking for java framework or library:
* [Awesome Java](https://github.com/akullpp/awesome-java)
Expand All @@ -56,4 +54,3 @@ When you are looking for java framework or library:
* [Linux Foundation](https://www.linuxfoundation.org/projects/)
* [Eclipse Foundation](https://projects.eclipse.org/)
* [Apache foundation](https://www.apache.org/index.html#projects-list)

0 comments on commit 8e98174

Please sign in to comment.