Basics of getting Started with Java

Source: Internet
Author: User
Tags connection pooling event listener java web

Https://course.tianmaying.com/java-basic%2Bjava-environment#0

David
Links: https://www.zhihu.com/question/25255189/answer/86898400
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

This tutorial runs the basics of getting started with Java in one instance, and goes a step further to help you get to the world of Java programming quickly. The beginning of everything is difficult, and gradually follow this tutorial go through, Java should have a sense of getting started. Then go on to learn more advanced topics, or learn some of the points in more detail.

  • 1th Lesson Java Development Environment installation and configuration
  • 2nd lesson the First Java program
  • Lesson 3rd Object-oriented Foundation
  • Lesson 4th Basic Data Types
  • 5th Lesson operator
  • 6th lesson String Manipulation
  • the control flow of the 7th lesson Program
  • The 8th lesson static variable and static method
  • 9th Lesson Java Collection
  • 10th Lesson Encapsulation and inheritance
  • Lesson 11th Abstract classes and Interfaces
  • 12th Lesson Exception Handling
  • A Comprehensive example of the 13th lesson
  • 14th Session Installation and use of Eclipse

After you get started, consider the following learning paths and content:

1, the basic path of learning

It is very important to establish a good development environment first, 工欲善其事, its prerequisite. To do any development, the first is to prepare the environment, then you can do a variety of attempts, the process can gradually build confidence. Beginners tend to be frustrated by unexpected problems in their environment configuration.

Build up the environment and change the world depends on your code. Learning a programming language does not have a lot of tricks, you may be able to find a better classic introductory books, now there is a lot of information on the web, graphics or video can be, according to personal preferences. The most important exercises, practice makes perfect, in the continuous practice to deepen their understanding of the programming language.

Next you need to understand these three terms, called the SDK, API and LIB, respectively, representing the software development Kit, application programming interface and library. There is a certain connection between the three, or a cross. In general, they are a few of the infrastructure that encapsulates the underlying functionality. In Java development, these things are often represented as "frameworks" that we often say. In fact, to be a senior Java developer, learning about the various APIs and frameworks is probably the most time-spent place.

Of course, you won't be able to fully understand all the APIs or all the content of the SDK. There are 28 principles in software development, and a handful of APIs are capable of doing most of the scenarios in development. So all you need to do is take a look at the key parts and see the Help documentation when you encounter new problems that can't be solved in a new scenario. So the reading of the Help document is also a key factor in technical learning. Once you've learned the basics, you'll generally be able to get started, and help documents help you learn in practice.

2, three artifacts

Three artifacts, very important for software developers.

    • The first Google, although for a variety of reasons, sometimes we can not access, but this is basically the best way to find technical information.
    • The second is GitHub, which mentioned the concept of a library, and GitHub is a place where you can find a large number of third-party libraries, which are reusable code that others have packaged for us. For example, to build a car, we often do not build wheels ourselves, and GitHub can find a lot of quality wheels, these wheels are free (the code is open source), we should try to use them to assemble their own cars.
    • The third is the StackOverflow website, where you can quickly find answers to almost any development problem you encounter on this quiz site.

3. Recommended learning content for Java Web full stack development

Briefly summarize, probably including the following content. Each part can be refined into a lot of knowledge points, this is just a rough list. Just think of it as a technical map.

    • Development environment Building and project management: Eclipse, maven, and Git
    • Fundamentals of Java Programming: Basic syntax, object-oriented features, JAVA8 new features, use of higher-level libraries (such as guava), etc.
    • Front-end development technology: HTML, CSS, Bootstrap, and JavaScript basics
    • Spring Basics: Dependency Injection IOC, aspect-oriented programming AOP, Springboot
    • MVC framework: Spring MVC, struts, etc., including URL routing, templates, forms, sessions, interceptors and other knowledge
    • Data access: relational database, JDBC, Spring JDBC, transaction, ORM Framework (Mybatis,hibernate, JPA)
    • Key feature implementations for mature applications: Mail sending, asynchronous tasks, caches, logs, and more
    • Testing and deployment of applications

Here is a detailed description of each section.

4, Jsp/servlet of the relevant content

Although now a variety of mature MVC framework has made Java Web development rarely use the native functionality of JSP and servlet, basically do a layer of encapsulation. But this part of the basic knowledge suggests that beginners should study hard.

    • Web base, HTTP protocol
    1. c/S model, browser access to website process
    2. Basic knowledge of URLs
    3. HTTP message--Request and response
    4. Applications that handle HTTP requests
    5. servlet/jsp Introduction

    • Servlet
    1. servlet container, servlet processing mechanism, servlet life cycle
    2. Deploying Servlets
    3. ServletContext, ServletConfig
    4. Filter, Event Listener

    • Jsp
    1. expression, scriptlet, declaration
    2. Accessing Java classes in JSPs
    3. JSP built-in objects

    • Handling user Input
    1. http method--get V.s. POST
    2. Reading form data

    • Building an MVC Application
    1. servlets/jsp Existing problems
    2. MVC design Pattern
    3. Using RequestDispatcher
    4. Passing data in Servlets and JSPs, El expression

    • Using Jstl as a template
    1. JSP Tag Lib
    2. Core Tag (if, loop)
    3. Function Tag (String, FMT, Utils)

    • Session
    1. Session&&cookie Basic Concepts
    2. Record user status via cookie (like shopping cart example)
    3. Use session to track users (login)

5, database-related content

With servlet/jsp technology in hand, we have been able to create dynamic Web applications. In addition to the Dynamic Web interface, a valuable Web application necessarily requires data storage, which we generally call data persistence (persistence).

From the point of view of business function, simple application can be considered as the data deletion and modification. For example, a product-level blog application, the most important feature is the creation of blog content, modification, deletion and query, and these functions are inseparable from the Web server behind the database system.

    • Basic concepts of databases
    1. Entities, relationships (tables), records (rows), Columns (properties)
    2. Primary key, foreign key, etc.
    3. Basic principles of database table design
    • SQL Basics
    1. MySQL Basic use
    2. Ddl--create,drop,alter in SQL, establishing constraints such as the foreign key of the primary key
    3. Dml--insert in SQL, select, delete, Update,join
    • Jdbc
    1. database connections, connection pooling
    2. Accessing the database using the JDBC API
    3. Paging Query
    4. Basic concepts of transactions
    5. Three-tier architecture for the encapsulation and data access of JDBC code

6. Spring Related content

Spring's most important two core features are dependency injection (di,dependency injection) and aspect-oriented programming (Aop,aspect oriented programming). Where di is used to manage dependencies between Java objects, AOP is used to decouple business code and Public Service code (such as logs, security, transactions, and so on). Di and AOP make code simpler, have good loose-coupling characteristics and testability, and greatly simplify development. Understanding the two is the basis for using the spring framework.

    • The core idea of spring
    1. Dependency Injection
    2. Facet-oriented programming (AOP)
    3. Pojo-based programming model
    4. Pre-built template code (such as spring JDBC)
    • Fundamentals of Dependency Injection
    1. Benefits of Dependency Injection
    2. How dependency injection is implemented
    • Use of Dependency Injection
    1. An XML-based assembly approach
    2. Assembly mode based on Java configuration
    3. Automatic assembly
    4. Mixing with multiple assembly methods
    5. Ambiguity in handling assembly
    6. How to inject property values
    • Scope of Spring Bean
    1. Singleton
    2. Prototype
    3. Request
    4. Session
    5. Global
    • Aop
    1. Basic concepts such as facets, target objects, tangent points, notifications, weaving, etc.
    2. How to: Define Tangency points ASPECTJ syntax for defining pointcuts
    3. Defining notifications
    • Pre-notification (before)
    • Post Notification (afterreturning)
    • Exception Notification (afterthrowing)
    • Final notification (after)
    • Surround Notification (Around)
    • How to pass a parameter to a plane

7. Spring MVC related content

Spring, as a full-stack (full-stack) Development framework for the Java system, is of course very well supported for web development. Spring's web MVC framework makes it easy for developers to develop Web applications while seamlessly enjoying the many benefits of spring itself--IOC containers, AOP programming, and more.

    • Spring MVC Fundamentals, configuration
    1. Dispatcherservlet
    2. Webapplicationcontext
    3. Processing the HTTP request process
    • Implementing a Controller
    1. @Controller, @RequestMapping annotations
    2. URL template mode, @PathVariable
    3. Gets the HTTP request parameters, @RequestParam
    4. Parameters supported by the @RequestMapping method
    5. Return values supported by the @RequestMapping method
    • An analysis of visual illustrations
    1. Working with Static resources
    2. Configure JSP
    3. Configuring additional template Engines
    4. Redirect, Flash Attribute
    • Form processing
    1. form data binding
    2. Spring form Labels
    3. Form validation
    4. File Upload
    5. Flash Attribute
    • Interceptor Interceptors
    1. Spring MVC Request Processing Flow
    2. Handlerinterceptor interface
    3. Configure Interceptor
    • Exception handling
    1. Configuration Error page
    2. Using HTTP status Codes
    3. @ExceptionHandler
    4. Controlleradvice Global Exception Handling
    • REST API
    1. @ResponseBody and @requestbody
    2. Handling put and delete requests

8, MyBatis related content

MyBatis is an excellent persistence layer framework that supports the customization of SQL, stored procedures, and advanced mapping. MyBatis avoids almost all JDBC code and manually sets parameters and gets the result set. MyBatis can use simple XML or annotations on configuration and native map to map interfaces and Java POJOs (Plain old Java Objects, ordinary Java objects) to records in a database

    • MyBatis Foundation
    1. The concept of ORM
    2. How to define the Mapper interface
    3. How to define XML Mapper mappings
    4. How to use Mapper

    • Basic use of MyBatis
    1. Sqlsessionfactory
    2. Sqlsessionfactorybuilder
    3. Sqlsession

    • Mybatis-spring
    1. Based on how spring configures and uses mapper
    2. Configuration of the Sqlsessionfactorybean
    3. MyBatis the use of Spring Boot starter

    • Change and delete
    1. Familiarity with mapper configuration files
    2. Select element
    3. The Resulttype property of the Select
    4. Insert Element
    5. Update element
    6. Delete Element

    • Complex queries
    1. Resultmap elements
    2. Association elements
    3. Nested results and nested queries
    4. Collection elements
    5. Discriminator Elements
    6. Dynamic SQL
    7. Paging query (Paging plugin)

9. JPA

The advent of ORM frameworks allows us to manipulate relational databases in an object-oriented manner, but it is still very tedious to implement the data access layer in the application system for a long time, and simple queries often involve a lot of repetitive code. Spring data JPA Further simplifies the implementation of the data access layer based on JPA, which provides a method similar to declarative programming, where developers only need to write data access interfaces (called repository), and spring data JPA can automatically generate implementations based on the method name in the interface.

JPA (Java persistence Api,java persistence API) that defines the standard interface for Object relational mapping (objects Relation Mapping,orm) and entity object persistence. JPA is a set of interface specifications, and JPA implementations include JBoss Hibernate Entitymanager, Oracle's donation to the Eclipse community Eclipselink, and Apache OpenJPA.

    • Core concepts of Spring Data JPA
    1. Repository
    2. Steps to use repository
    3. Custom Repository Interface
    4. Repository interface hierarchy and its methods
    • Defining entity Classes
    1. Automatically generate database schema
    2. @Entity and @table
    3. @Id and @generatedvalue
    4. @Basic
    5. @Column
    6. @Transient
    7. @Temporal
    8. @Lob

    • Define a one-to-one relationship
    1. @OneToOn
    2. @JoinColumn
    3. Unique attribute
    4. Bidirectional @onetoone Association
    5. Bidirectional correlation and Cascade
    6. Automatic mapping of naming rules

    • One-to-many and many-to-many relationships
    1. @ManyToOne
    2. @OneToMany
    3. @ManyToMany
    4. Jointable
    5. Using @manytoone to achieve many-to-many
    • Other
    1. How to create a query from a method name
    2. Paging and sorting
    3. @Query annotations
    4. Transaction

10. Deployment of Java Web applications

    • War package specification and structure
    • Debugging and deploying in the IDE
    • Exporting a war package using the IDE
    • Deploy the war package to the server
    • Spring Boot-based deployment

11. Other topics

Cache: EhCache, Spring cache Manager, Data tier cache, service tier cache, page cache

Security: Spring Security (HTTP Basic Authentication, role verification, permission validation)

Task Scheduler: Spring Task Executor (Executor)

Mail sending: SMTP protocol, Spring-boot-starter-mail

Web Socket: @SubscribeMapping, Websocketconfig

Logs: Slf4j and Logback, Spring Boot Logging, Consoleappender/rollingfileappender, Sentry, ELK

12. Design mode

Reference Java to write a beautiful set of code, which design patterns are more commonly used? -David's answer--know

13. Further

Distributed, in-depth Java virtual machines, for different scenarios of the Java Technology Framework, to this stage is not just Java learning, but the large-scale application of technology accumulation, architecture design of the refined.

can refer to Java Web full-stack development of practical courses

Basics of getting Started with Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.