-
Course
- Core Tech
Java 8 Fundamentals: The Java Reflection API Method Handles
The Reflection API brings class and object introspection to Java, on top of which Spring and Hibernate are built. This course covers object creation, field modification, and method invocation.
What you'll learn
As a Java developer, mastering the reflection API allows you to build powerful frameworks that will bring advanced functionalities to your application. In this course, Java Fundamentals: The Java 8 Reflection API Method Handles, you will learn how you can use reflection API efficiently. This API is very technical, so this course is organized around the study of two real-life use cases: the building of an Object Relational Mapper, on the model of Hibernate, and the creation of a dependency injection framework, on the model of Spring. First, you will understand how to introspect classes and objects and how to discover their structure. Next, you will learn how to build objects without knowing their class at compile time, to set values to their fields and to invoke their methods. Finally, you will understand the performance issues of this API, and be able to use method handles and var handles to fix these issues. By the end of this course, you will be able to master the reflection API that will help you in creating performant and versatile Java applications.
Table of contents
- Version Check | 16s
- Introduction to the Course, What Are You Going to Learn? | 2m 50s
- Who Are You? What Should You Know to Follow This Course? | 56s
- Agenda of the Course | 1m 54s
- Agenda of This Module | 40s
- Introducing the Java Reflection API: Class, Field, and Method | 1m 40s
- Introducing the Class Named Class, Getting an Instance of Class | 1m 37s
- Getting a Class Instance Using the Object.getClass() Method | 3m 9s
- Getting a Class Instance from the Name of the Class | 2m 44s
- Wrapping up the Three Patterns to Get a Class Object | 45s
- Getting the Super Class and the Implemented Interfaces of a Class | 2m 18s
- Getting the Declared and Non Declared Fields of a Class | 4m 12s
- Getting the Methods and the Constructors of a Class | 2m 56s
- Reading the Modifier to Tell if a Class Member Is Public | 4m 2s
- Demo: Using the Reflection API to Read Fields and Methods | 6m 34s
- Module Wrap Up | 58s
About the author
Passionate about programming computers for over 20 years, Jose made his debut in assembler and C, C for SIMD parallel machines before adopting Java as an object-oriented language. Assistant professor in Paris North University for more than 15 years, Jose also brings his expertise to many projects, in various industrial fields.
More Courses by Jose