Skip to content

Commit

Permalink
update checklist.md reference (#1715)
Browse files Browse the repository at this point in the history
boroda4436 authored Oct 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 60029bc commit 57f404c
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# jv-oop

- Create class Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`.
- Create classes `Truck`, `Bulldozer`, `Excavator` that will inherit from `Machine`.
- In those classes override `doWork()`, so it will print message that certain machine started its work.
- Override `stopWork()` as well. It should print messages that certain machine stopped its work.
- In `MainApp` class create `Machine` array with `Truck`, `Bulldozer` and `Excavator` and call methods `doWork()` and `stopWork()` in a loop.
- Create classes `Truck`, `Bulldozer`, and `Excavator` that will inherit from `Machine`.
- In those classes override `doWork()`, so it will print a message that a certain machine started its work.
- Override `stopWork()` as well. It should print messages that certain machines stopped working.
- In the `MainApp` class create a `Machine` array with `Truck`, `Bulldozer`, and `Excavator` and call methods `doWork()` and `stopWork()` in a loop.

#### [Try to avoid these common mistakes, while solving task](https://mate-academy.github.io/jv-program-common-mistakes/java-core/oop/oop)
#### [Try to avoid these common mistakes, while solving task](./checklist.md)
12 changes: 6 additions & 6 deletions checklist.md
Original file line number Diff line number Diff line change
@@ -22,17 +22,17 @@ public class Main {
```

#### Write informative messages in methods.
Use english only and make them informative:
message should indicate what type of `Machine` is working right now `Truck`, `Bulldozer` or `Excavator`.
- Use English only and make messages informative
- The message should indicate what type of `Machine` is working right now `Truck`, `Bulldozer` or `Excavator`.

#### Use abstract reference instead of specific one where possible:
#### Use abstract references instead of specific ones where possible:
* Bad example:
```
Cat fluffy = new Cat();
Dog oscar = new Dog();
```
This example is bad cause it won't allow us to use polymorphism in our code.
Our reference is now bonded to specific implementation, but it is always better to depend on the abstraction.
Our reference is now bonded to a specific implementation, but it is always better to depend on the abstraction.
Let's see how we can improve it:
* Improved example:
```
@@ -42,8 +42,8 @@ Animal oscar = new Dog();

#### Depending on the case, class elements should have different access modifiers
Remember that if you don't use any access modifiers that will apply the default one. Do we always want
to have all elements with default access modifiers? Remind yourself about encapsulation principle and
to have all elements with default access modifiers? Remind yourself about the encapsulation principle and
when private or public should be used.

#### Write informative messages when you commit code or open a PR.
Bad example of commit/PR message: `done`/`fixed`/`commit`/`solution`/`added homework`/`my solution` and other one-word, abstract or random messages.
Bad examples of commit/PR messages: `done`/`fixed`/`commit`/`solution`/`added homework`/`my solution` and other one-word, abstract or random messages.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>compile</phase>

0 comments on commit 57f404c

Please sign in to comment.