Skip to content

Commit 7429be4

Browse files
Ranga Rao KaranamRanga Rao Karanam
Ranga Rao Karanam
authored and
Ranga Rao Karanam
committed
Adding more images
1 parent 0623099 commit 7429be4

File tree

1 file changed

+48
-52
lines changed

1 file changed

+48
-52
lines changed

README.md

+48-52
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# java-best-practices
1+
# Java Best Practices
22
Best practices in Coding, Designing and Architecting Java Applications
33

44

5-
# Coding
5+
## Coding
6+
7+
###How to become a good programmer?
8+
![How to become a good programmer?](images/BecomingAGreatProgrammer.png)
9+
10+
###Code Quality Overview
11+
![Code Quality Overview](images/CodeQuality.png)
612

7-
## Code Quality
813
- More than everything else, code quality is an attitude. Either, the team has it or not. The attitude to refactor when something is wrong. The attitude to be a boy scout. As an architect, it is important to create an environment where such an attitude is appreciated. (There are always bad sheep, who take the code quality to such depth that it is not fun anymore, but I like them more than developers who keep churning out bad code).
914
- Have a good static analysis tool(and is part of Continuous Integration). Sonar is the best bet today. Understand the limits of Static Analysis. Static Analysis is not a magic wand. For me, results from Static Analysis are a signal: It helps me decide where I should look during peer or architect reviews?
1015
- Have good peer review practices in place. Every user story has to be peer reviewed. Put more focus on peer reviews when there is a new developer or there is a new technical change being done. Make best use of Pair Programming. The debate is ongoing : Is pair programming more productive or not? I would rather stay out of it. You make your choice. However, these two scenarios are bare minimum:
@@ -24,7 +29,8 @@ Best practices in Coding, Designing and Architecting Java Applications
2429
- Be conscious about create as few objects as possible. Especially in loops.
2530
- Avoid String Concatenation
2631
- Close connections and Streams
27-
-
32+
![Java Performance](images/JavaPerformance.png)
33+
2834
## Load and Performance Testing
2935
- PDF Presentation https://www.mindmup.com/#m:g10B8KENIDghuHAUjlYVmlfSllzTzg
3036
- Have clear performance objectives. That’s the single most important objective. Decide Peak Load, Expected Response Time, Availability Required before hand.
@@ -36,8 +42,9 @@ Best practices in Coding, Designing and Architecting Java Applications
3642
- Make sure team is not making 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%."
3743
- Have Clear Strategy on How to Handle expected load. What would be the initial settings on the application server? Do you plan to use a clustered environment? Do you need a load balancer?
3844

39-
# Design
40-
## Design Focus Areas
45+
## Design
46+
###Design Focus Areas
47+
![Focus](images/Design-Focus.png)
4148
- 4 Principles of Simple Design. https://www.youtube.com/watch?v=OwS8ydVTx1c&list=PL066F8F24976D837C
4249
- Runs all tests
4350
- Minimize Duplication
@@ -56,36 +63,44 @@ Best practices in Coding, Designing and Architecting Java Applications
5663
- Deployment diagrams
5764
- Design Patterns. Following video covers all the major design patterns. https://www.youtube.com/watch?v=0jjNjXcYmAU. 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.
5865

59-
# Architecture
66+
###Design Review
67+
![Review](images/DesignReview.png)
68+
69+
## Architecture
6070
- PDF : [https://www.mindmup.com/#m:g10B8KENIDghuHAZWh2SEhSNTdNNjA]
6171

62-
##Great Architect
63-
- Creating a clean architecture based on sound principles. Architecture covering all Non Functional Requirements.
72+
### Architect Responsibilities
6473
- Having good governance in place. Good review processes in place for Architecture, Design and Code.
74+
- Creating a clean architecture based on sound principles. Architecture covering all Non Functional Requirements.
6575
- Ensuring teams are as productive as they can be. Right tools.
6676
- Ensuring teams are following the best engineering practices.
6777
- Ensuring clear communication about architecture with business and technical teams.
78+
![Architect Responsibilities](images/ArchitectResponsibilities.png)
6879

69-
## Qualities
80+
### Architect Qualities
7081
Most important qualities I look for in an Architect are
7182
- Impeccable Credibility : Somebody the team looks up to and aspires to be.
7283
- Super diagnostic skills : The ability to do a deep dive on a technology issue. When developers are struggling with a problem (having tried different things), Can he/she provide a fresh pair of eyes to look at the same problem?
7384
- Forward Thinker and Proactive : Never satisfied with where we are. Identifies opportunities to add value fast.
7485
- Great Communication : Communication in the widest sense. Communicating the technical aspects to the stakeholders, project management, software developers, testers, etc.
86+
![Architect Qualities](images/ArchitectQualities.png)
7587

76-
## SOAP Web Services
88+
###Architecture Review
89+
![Architecture Review](images/ArchitectureReview.png)
90+
91+
### SOAP Web Services
7792
![SOAP Web Services](images/SOAPWebServices.png)
7893

79-
## REST Web Services
94+
### REST Web Services
8095
- PDF https://www.mindmup.com/#m:g10B8KENIDghuHAYmFzM0daOU80SDA
8196

82-
## Distributed Cache
97+
### Distributed Cache
8398
![Distributed Cache](images/DistributedCache.png)
8499

85-
## Layers
100+
### Layers
86101
- PDF https://www.mindmup.com/#m:g10B8KENIDghuHAemVIS2RvT1JDOUE
87102

88-
### Business Layer
103+
#### Business Layer
89104
Listed below are some of the important considerations
90105
- Should I have a Service layer acting as a facade to the Business Layer?
91106
- How do I implement Transaction Management? JTA or Spring based Transactions or Container Managed Transactions? What would mark the boundary of transactions. Would it be service facade method call?
@@ -96,14 +111,14 @@ Listed below are some of the important considerations
96111
- Are there any Operations specific logging or auditing that is needed?Can we implement it as a cross cutting concern using AOP?
97112
- Do we need to validate the data that is coming into the Business Layer? Or is the validation done by the web layer sufficient?
98113

99-
### Data Layer
114+
#### Data Layer
100115
- Do we want to use a JPA based object mapping framework (Hibernate) or query based mapping framework (iBatis) or simple Spring DO?
101116
- How do we communicate with external systems? Web services or JMS? If web services, then how do we handle object xml mapping? JAXB or XMLBeans?
102117
- How do you handle connections to Database? These days, its an easy answer : leave it to the application server configuration of Data Source.
103118
- What are the kinos of exceptions that you want to throw to Business Layer? Should they be checked exceptions or unchecked exceptions?
104119
- Ensure that Performance and Scalability is taken care of in all the decisions you make.
105120

106-
### Web Layer
121+
#### Web Layer
107122
- First question is do we want to use a modern front end javascript framework like AngularJS? If the answer is yes, most of this discussion does not apply. If the answer is no, then proceed?
108123
- Should we use a MVC framework like Spring MVC,Struts or should we go for a Java based framework like Wicket or Vaadin?
109124
- What should be the view technology? JSP, JSF or Template Based (Velocity, Freemarker)?
@@ -113,24 +128,24 @@ Listed below are some of the important considerations
113128
- How do we Authenticate and Authorize users? Do we need to integrated external frameworks like Spring Security?
114129
- Do we need to expose external web services?
115130

116-
# Tools
131+
## Tools
117132

118-
## Maven Best Practices
133+
### Maven Best Practices
119134
![Maven Best Practices](images/MavenBestPractices.png)
120135

121-
###10 Tips For Maven
136+
#### 10 Tips For Maven
122137
[10 Tips for Eclipse and Maven](pdf/10TipsforEclipseAndMaven.pdf)
123138

124-
## IDE - Eclipse
139+
### IDE - Eclipse
125140
![Eclipse](images/Eclipse.png)
126141

127-
###10 Tips For Eclipse
142+
#### 10 Tips For Eclipse
128143
[10 Tips for Eclipse and Maven](pdf/10TipsforEclipseAndMaven.pdf)
129144

130145

131-
# Practices
146+
## Practices
132147

133-
## Agile and Architecture
148+
### Agile and Architecture
134149
- First of all I’m a great believer that agile and architecture go hand in hand. I do not believe agile means no architecture. I think agile brings in the need to separate architecture and design. For me architecture is about things which are difficult to change : technology choices, framework choices, communication between systems etc. It would be great if a big chunk of architectural decisions are made before the done team starts. There would always be things which are uncertain. Inputs to these can come from spikes that are done as part of the Done Scrum Team.But these should be planned ahead.
135150
- Architecture choices should be well thought out. Its good to spend some time to think (Sprint Zero) before you make a architectural choice.
136151
- I think most important part of Agile Architecture is Automation Testing. Change is continuous only when the team is sure nothing is broken. And automation test suites play a great role in providing immediate feedback.
@@ -140,7 +155,8 @@ Listed below are some of the important considerations
140155
[Design in Agile Projects](pdf/AgileAndDesign-Evolution.pdf)
141156

142157

143-
## Modern Development Practices
158+
### Modern Development Practices
159+
![Modern Development Practices](images/ModernDevelopmentPracticesOverview.png)
144160
- Unit Testing and Mocking : We are in the age of continuous integration and delivery, and the basic thing that enables those is having a good set of unit test in place. (Don’t confuse unit testing with screen testing done manually to check if the screen flow is right. What I mean by unit testing is JUnit test’s checking the business logic/screen flow in a java method (or) set of methods). Understand JUnit. Here is a good start : https://www.youtube.com/watch?v=AN4NCnc4eZg&list=PL83C941BB0D27A6AF. Also understand the concept of Mocking. When should we mock? And when we should not? Complicated question indeed. Understand one mocking framework : Mockito is the most popular one. Easymock is a good mocking framework as well.
145161
- Automated Integration Tests. Automated Integration Tests is the second important bullet in enabling continuous delivery. Understand Fitnesse, Cucumber and Protractor.
146162
- TDD (actually I wanted to put it first). Understand what TDD is. If you have never used TDD, then be ready for a rude shock. Its not easy to change a routine you developed during decades (or years) of programming. Once you are used to TDD you never go back. I promise. This list of videos is a good start to understanding TDD. https://www.youtube.com/watch?v=xubiP8WoT4E&list=PLBD6D61C0A9F671F6. Have fun.
@@ -149,7 +165,7 @@ Listed below are some of the important considerations
149165
- Continuous Integration. Every project today has continuous integration. But, the real question is “What is under Continuous Integration?”. Compilation, unit tests and code quality gate(s) is the bare minimum. If you have integration and chain tests, wonderful. But make sure the build does not take long. Immediate feedback is important. If needed, create a separate build scheduled less frequently for slower tests (integration and chain tests). Jenkins is the most popular Continuous Integration tool today.
150166
[[ModernDevelopmentPractices.png]]
151167

152-
### Important Questions
168+
#### Important Questions
153169
- How often is code commited?
154170
- How early are problems/defects found/fixed?
155171
-- Code Quality, Code Review, ST Defects
@@ -166,48 +182,28 @@ Listed below are some of the important considerations
166182
- Chain Tests
167183
- How long does a Continuous Integration build run for? Is there a need for multiple builds?
168184

169-
## Productive Developers
185+
### Productive Developers
170186

171-
##Unit Testing Best Practices
187+
### Unit Testing Best Practices
172188
[Unit Testing Best Practices](pdf/UnitTestingBestPractices.pdf)
173189

174-
##Architect Qualities
175-
![Architect Qualities](images/ArchitectQualities.png)
176-
##Architect Responsibilities
177-
![Architect Responsibilities](images/ArchitectResponsibilities.png)
178-
##Architect Review
179-
![Architect Review](images/ArchitectureReview.png)
180-
##How to become a good programmer?
181-
![How to become a good programmer?](images/BecomingAGreatProgrammer.png)
182-
##Code Quality Overview
183-
![Code Quality Overview](images/CodeQuality.png)
184-
##Design
185-
###Focus
186-
![Focus](images/Design-Focus.png)
187-
###Review
188-
![Review](images/DesignReview.png)
189-
###Java Performance
190-
![Java Performance](images/JavaPerformance.png)
191-
###Modern Development Practices
192-
![Modern Development Practices](images/ModernDevelopmentPracticesOverview.png)
190+
### Code Reviews
191+
193192
###Static Code Analysis
194193
![Static Code Analysis](images/StaticCodeAnalysis.png)
195194

196-
## Code Reviews
197-
198195
### Good Code
199196
- PDF : https://www.mindmup.com/#m:g10B8KENIDghuHANmRyVmpGb3lINEE
200197

201198
### Peer Reviews
202199
- PDF : https://www.mindmup.com/#m:g10B8KENIDghuHAbWdfWVdrVU1VMEU
203200

204-
205201
### SONAR
206202
- One Slide from PDF - Making use of SONAR
207203
- https://www.mindmup.com/#m:g10B8KENIDghuHAbWdfWVdrVU1VMEU
208204

209205

210-
# Indian IT
206+
## Indian IT
211207

212-
# Campus Interview Guide
208+
## Campus Interview Guide
213209
- https://docs.google.com/document/d/1IP6HNgpMdCAAJEREowfBj2XPLBrPcIIFNIGFPGX0-ao/edit#heading=h.byb5dl2v0c4p

0 commit comments

Comments
 (0)