The next issue of the “Technopark Lectures” column is on air. This time, you can study the lectures of a course on advanced Java programming. The goal of the course is to provide students with practical skills for creating a client-server application using the example of developing a simple multiplayer online game server in small groups (4-6 people).
Lecture 1. Introduction to the Java platform tools.Servlets
The history of Java. Definitions of the concept of "cross-platform". The structure of a Java application. The goals for which the language was created, its advantages and disadvantages. Java platform overview. Garbage collector. Java versions. Naming in Java. Developer tools. Creating a project. Meet the Jetty. Java servlet. Code examples.
')
Lecture 2. User authorization.Templates, collections
Setting the task of authorization of the user, description of the conditions. Modules and processes involved in the registration, authorization, account processing and user logout operations. Familiarity with Java templates. Class with template type. Method with template type. Syntax. Narrowing the parameter area. Specific use of templates. Patterns and inheritance. Definition of collections. Interfaces for working with collections. Container hierarchy. List, Set, Queue, Map. Comparable interface comparison. HTTP session.
Lecture 3. In-depth basics of the language, the deployment of the project
Inheritance in Java. Multiple inheritance. Work with classes. ClassLoader - class data loader. The main methods of the class. Primitive types and their wrappers. Boxing and Unboxing. Arrays in java. String variables. The size of objects in java. Administer the server. PORT in parameters. Maven is a build tool. Build and run the project. Stop the server.
Lecture 4. Testing and load
Software quality assurance: criteria, assessment of compliance with criteria, formal checks. Automation of quality assurance: static code analysis, tests, commit hooks, continuous integration. Approaches to testing. Unit tests. Functional and load testing. Check individual modules. Safe refactoring. Module compatibility. Protection against repeating bugs. Requirements for tests. The first test. Terminology testing. Abstraction. Interface and test implementation. Doubles: Fake, Dummy, Stabs, Spies, Mocks, Mockito. Rules for testing. Waiting for an exception. Functional tests. Organization, tools and load testing results. Garbage collector. Interface Autoclosable. Garbage collector in Java 7 and 8. Logging. Remote debugging. Using the Java Management eXtension extension.
Code organization. Interfaces Services and descriptors. Code changes. Reactor. Annotations - metadata about the code. Notnull Standard annotations. Syntax, processing and types of annotations. WebSockets. Analysis of game mechanics and connections with the user on the example of the game "Who will naklikat more." Templates Singleton and Context. Exceptions and their role. Throwable class. Events, their registration. Pattern Observer. Callbacks
Lecture 6. Working with the file system
I / O streams. Byte streams (Byte Streams). Decorator pattern. Closing threads. The concept of serialization. Serializable interface. What undergoes and does not undergo serialization. Write to file. Deserialization. Reflection: parse an object and translate it into an array of bytes. Features Reflection, its disadvantages. ReflectionHelper. Serialize an XML document. SAX parser, its methods. XML deserialization. Handler Using Reflection. DOM parser. Resource system, Resource interface, resource factory.
Lecture 7. Work with databases (part 1)
Terms and abbreviations. Instruments. The definition and features of JDBC, its API. JDBC driver management. Connection with base (Connection). The state of connections (Statements). ResultSet object. The solution of the problem of transferring the interface in Java 7 and Java 8 (lambda expression). An Executor object containing methods for working with queries. Update and select states. Call execQuery. Typification.
Lecture 8. Work with bases (part 2)
The relationship between the object model of the program and the relational model of the base (Object-Relational Mapping). Java Persistence API. DataSet is an object containing data of one row of the table. The object of data access (Data Access Object), options for operations on the database. Interface UsersDAO. ORM-library Hibernate, its configuration. Creating or checking the base schema when creating a SessionFactory. Session Factory. Annotations for DataSet. Meet Hibernate Query Language. Insert and read HQL, search by key, getting all records. Service hiding work with the database (Database Service). Transactions on two or more tables.
Lecture 9. Multithreading
Definition of processes and threads. The role of the operating system when working with threads. Runnable interface. Class thread. Access to stream object. Stop execution and interrupt thread execution. Stop the current thread to end another. Terms related to multithreading. Critical code section. Semaphore, Mutex. Soft and mandatory lock. High level monitor design. Thread interaction. Possible errors of simultaneous access. Model of interaction of threads through shared memory. Synchronization, its methods and states. Locking objects. Deadlock situation. Service in a separate thread. The wait () and notify () methods. Containers, safe for multi-thread access.
Lecture 10. Messaging System
Server architecture, option without multithreading. The concept of messaging within the server. Thread interaction. The object for exchanging data for the MessageSystem. Classes Address, Abonent and Message. Authorization message. Message hierarchy Using MessageSystem. Interaction of Frontend and AccountService flows. States. Load Balancing: AddressService.