Download Java-GUI-Hack-Tutorial-and-Resources

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java GUI Hack-a-thon with Spring
Prepared By: Suhaib Qaiser ([email protected])
Purpose:
Tutorial on Java Spring
Objectives:











To learn how to setup basic Spring based application with maven
To learn how to setup GitHub profile for every team and upload code there
To learn how to use Eclipse or any other popular code editor
To use latest graphical user interface tools with Spring framework
To go through popular java coding conventions to improve code quality
To learn using Apache Tomcat for code deployment
To learn how to perform Junit testing and concepts of test driven development
Learn Java coding design patterns
Exception handling techniques
Learn Model View Controller
Learn how to implement JSF and JSP as view technologies
Pre-Requisites:





You all should have Apache Maven installed on your computer. Follow these steps:
http://maven.apache.org/install.html
You should have latest version of Git installed on your system. Follow these steps: https://gitscm.com/book/en/v2/Getting-Started-Installing-Git
You should have latest version of Eclipse installed on your system. Follow these steps:
https://www.eclipse.org/users/
You should have Apache Tomcat 7 or 8 installed on your system. Follow these steps:
https://tomcat.apache.org/tomcat-7.0-doc/setup.html
You should all have your GitHub account created and download GitHub desktop:
https://github.com/personal
Phase 1:
Setup of Java Spring Application using Maven
The first step for you is to setup a Hello World Spring Web MVC Application using Maven. Below you will
find more description for each term:
a. Java Spring Framework
The Spring Framework is a Java platform that provides comprehensive infrastructure support for
developing Java applications. Spring handles the infrastructure so you can focus on your application.
Spring enables you to build applications from "plain old Java objects" (POJOs) and to apply enterprise
services non-invasively to POJOs. This capability applies to the Java SE programming model and to full
and partial Java EE.
Examples of how you, as an application developer, can benefit from the Spring platform:




Make a Java method execute in a database transaction without having to deal with transaction
APIs.
Make a local Java method a remote procedure without having to deal with remote APIs.
Make a local Java method a management operation without having to deal with JMX APIs.
Make a local Java method a message handler without having to deal with JMS APIs.
[Source: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/overview.html]
b. Apache Maven
Apache Maven is a software project management and comprehension tool. Based on the concept of a
project object model (POM), Maven can manage a project's build, reporting and documentation from a
central piece of information.
[Source: https://maven.apache.org/]
Below are the steps involved in setting up the project:
A. First of all open the URL and download zip: https://github.com/suhaibqaiser/java-spring-hackathon
B. Copy/Paste the zip file in your local workspace that you have chosen while setting up Eclipse
C. Unzip the file and extract the project folders
Follow instructions from speaker in the workshop for further details.
Phase 2:
Learn Java Coding Conventions
Open URL:
http://www.oracle.com/technetwork/java/codeconventions-150003.pdf
Popular standards to follow:
1. Indentation
a. All modern IDEs for Java programming support auto indentation. Make sure you are not
leaving unwanted spaces
2. Variable Naming Conventions:
a. Make sure to follow naming conventions as outlined in the document sections
3. Variable Declarations:
a. Make sure to initialize variables in the start of method
b. Initialize one variable per line
c. Make sure to follow Static and Final as required
d. Always initialize a variable
4. Compound IF Statements
a. Try to avoid using compound IF statements unnecessary
b. If the conditions are much complex. Try using separate methods for each condition
c. Try using a Boolean isValid for validations instead of returning in between methods and
if blocks
d. Try avoiding a complex statement after returning an object
5. Use of Object Oriented techniques
a. Make use of abstract classes as much as possible
b. Make use of inheritance as much as possible
c. Make use of encapsulation as much as possible
6. Comments
a. Put block comments on methods
b. Put line comments for complex statements
c. Put Class block comments on all classes
Phase 3:
Design Patterns
Popular Design Patterns:
1.
2.
3.
4.
5.
Singleton Design Pattern
Factory and Abstract Factory Design Pattern
Model View Controller
Dependency Injection
Decorator Pattern
URL: http://edeleastar.github.io/design-patterns/topic00/pdf/c-logica-gof-catalogue.pdf
Book: https://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Orientedebook/dp/B000SEIBB8