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: README.md
+134-1
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,130 @@
1
1
# Java Best Practices
2
2
Best practices in Coding, Designing and Architecting Java Applications
3
3
4
-
5
4
## Coding
6
5
7
6
###How to become a good programmer?
8
7

9
8
9
+
###Ask Why?
10
+
- Ask Why?
11
+
12
+
### Should I be an expert at all Design Patterns?
13
+
- My personal view : Design Patterns are good to know. Have a good idea on what each one of them does. But, that where it ends. I’m not a big fan of understanding the intricate details of each Design Pattern. You can look it up if you have a good overall idea about Design Patterns.
14
+
- Full Video on Design Patterns : https://www.youtube.com/watch?v=f5Rzr5mVNbY
15
+
- Java EE Design Patterns : https://github.com/in28minutes/Java-EE-Design-Patterns/blob/master/JavaEE%20Design%20Patterns%20and%20Architecture%20-%20Presentation%20v0.7.pdf
### How can you increase performance and reliability of applications using Queues?
31
+
32
+
### What are the most important coding standards?
33
+
- Complexity of a method
34
+
- Naming variables, methods and classes
35
+
- Size of methods and classes
36
+
- Number of parameters
37
+
38
+
### Why is unit testing important?
39
+
40
+
### Why should a good programmer understand Mocking?
41
+
42
+
### Why is it important to have an API Standard?
43
+
- YARAS
44
+
45
+
### Why should you create a reference component?
46
+
47
+
### What is the importance of Logging and Centralized Monitoring?
48
+
49
+
### What happens behind Maven? What is a Repository?
50
+
51
+
### Automate! Automate! Automate!
52
+
- Why is it important?
53
+
- Personal Experience with Deployment Automation, Providing user screen with requests/responses
54
+
55
+
### When should you have multiple CI builds?
56
+
57
+
### Why is performance of Unit Tests important?
58
+
59
+
### What are Cloud Native Applications?
60
+
61
+
### What are micro-services?
62
+
63
+
### Why should you avoid floats for Calculations?
64
+
65
+
### Why is it important to use Continuous Integration from Day 0 of the project?
66
+
67
+
### What is a vertical slice? Why should you need it?
68
+
69
+
### What is defensive programming?
70
+
71
+
### Why should you have minimum scope for variables?
72
+
73
+
### Why should you understand performance of String Concatenation?
74
+
75
+
### Why should you optimize judiciously?
76
+
77
+
### What are the best practices with Exception Handling?
78
+
79
+
### When is it recommended to prefer Unchecked Exceptions?
80
+
- Spring Framework
81
+
82
+
### When do you use a Marker Interface?
83
+
84
+
### Why are ENUMS important for Readable Code?
85
+
86
+
### Why should you minimize mutability?
87
+
88
+
### What is functional programming?
89
+
90
+
### Why should you prefer Builder Pattern to build complex objects?
91
+
92
+
### Why should you build the riskiest high priority features first?
93
+
94
+
### Why should you have api & impl in each layer maven projects?
95
+
96
+
### Why should you create small components?
97
+
98
+
### Why should you have coding standards?
99
+
100
+
### Why should you migrate to GIT?
101
+
102
+
### What are the 4 Principles of Simple Design?
103
+
104
+
### What is Pair Programming?
105
+
106
+
### Whatt are Best Practices of Distribute Agile?
107
+
108
+
### Why is readable code important?
109
+
110
+
### What is component based architecture?
111
+
112
+
### Why should you commit your code often?
113
+
114
+
### What is use of Maven Parent POM?
115
+
116
+
### Why should you write unit tests with/before code?
117
+
118
+
### What are version control best practices
119
+
- Do not commit derived files.
120
+
- Do not commit IDE files.
121
+
- Commit often
122
+
- Use Git
123
+
124
+
### A few design patterns...
125
+
126
+
### Why do Stateless applications perform better?
127
+
10
128
###Code Quality Overview
11
129

12
130
@@ -18,6 +136,12 @@ Best practices in Coding, Designing and Architecting Java Applications
18
136
- Next question is how to approach a Code Review. Difficult to cover everything. I would make a start. When doing a code review, I start with static analysis results (for example, sonar). I spend 10 minutes getting an overview of components and/or layers (focusing on size and dependencies). Next I would pick up a unit test for a complex functionality. I feel unit tests are the best place to discover the dependencies and naming practices (I believe good names = 50% of maintainable code). If a programmer can write a simple and understandable unit test, he can definitely write good code. Next, I look for 4 principles of Simple Design. After this, there are 100 other things we can look for - You decide.
19
137
- PDF - https://www.mindmup.com/#m:a1972695706ab201340d4b0beac29b8bfc
20
138
139
+
### Why should you not take code quality tools at face value?
140
+
- If a project has a great Sonar report, does it mean it is perfect?
141
+
- Nope, code quality tools are just a guidance!
142
+
- Your focus should be to write code that adheres to "4 Principles of Simple Design"
143
+
- Peer Reviews are necessary!
144
+
21
145
## Performance
22
146
23
147
- First and Foremost - NO premature optimizations. Any optimization decision should be based on numbers or past experience. In Donald Knuth's paper "Structured Programming With GoTo Statements", he wrote: "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of non critical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%."
@@ -94,6 +218,9 @@ Most important qualities I look for in an Architect are
94
218
### REST Web Services
95
219
- PDF https://www.mindmup.com/#m:g10B8KENIDghuHAYmFzM0daOU80SDA
96
220
221
+
#### How should you document your REST Web Services?
222
+
- Swagger
223
+
97
224
### Distributed Cache
98
225

99
226
@@ -204,6 +331,12 @@ Listed below are some of the important considerations
0 commit comments