In this video, walk through the course project. During this course you are building a web application that uses the most important Bean Validation features. This is an ideal way to learn Bean Validation in a fun and practical way.
- [SPEAKER] During this course, you'll be building a web application that uses all of the Bean Validation features covered in the course. This is a fun and practical way to learn Bean Validation. The application that we will be building together is a simplified stock market trading application called Gecko. We will be adding Bean Validation in the right places to enforce all the necessary business rules that an application like this needs to have in place. OK, so now, let me show you around the application. This is the home page and is the first page you will see as soon as the application is deployed.
There are three areas to the site, the Client Administration, the Stock Management function and the Trade Centre. So, in the client section, you will see a list of current clients. Now, at the moment, we only have three clients and I can add a new client by clicking on the Create New button. Now on this screen, I can enter data related to a client, so let's do that. So, I'm going to add myself as a client. I need to enter a date of birth, which is going to be not my real date of birth, my email address, my credit card number, now this needs to be a valid credit card number, so I'm going to enter 6011111111111117 and click the Accept Terms of Service button.
And all I need to do is to click Save and I will create myself a new client. As you can see, we now have four clients in our system. So, what I can do is I can have a look at an individual client. So, for example, let's have a look at Jane Brown. By going to the client, I can perform various functions. I can create a new client, I can edit the current client, I can view all details relating to the client and I can view all of the transactions that this client has related to their account. So, let's go and have a look at the Stock Management section.
Here is a list of the stocks in the system. These are the stocks that can be bought and sold by the Gecko Brokers trading platform. There aren't too many right now, so let's add one. So, what I need to do is I need to add a name, so we'll call it Boogle Search Inc. and just add a three-letter code, so I'm going to call it BOO. And click Save and there we have it, our new stock has been added to the system. This stock is now available for our clients to trade. And, finally, let's take a look at the Trading Centre.
This shows all the transactions in the system. A new transaction can be added by clicking New. All I need to do is, I need to select the client. As you can see, I have all of these clients, so I'm going to select Jane Brown as my client. I can select whether I'm going to buy or sell and I can choose a stock that I can buy or sell. I'm going to buy some BOO stock, quantity, I can enter my quantity, so I want a thousand units. I can enter a limit price, so let's say 10 is my limit price.
Then, I can enter a date when I want this to be exercised. So, let's say the 24th of December 2018. Of course, this must be a future date and then click Save. And there we have it, I've created myself a new transaction in the system. And as you can see here, the transaction is detailed here. I can also click on this transaction and view this transaction in more detail, like so. What I can also do is I can go into The Client Administration section, look at a client and then view all the transactions for that client.
If I click here, I can see here the transaction I've just entered for our client, Jane Brown. And that is the tour of the Gecko Broker application we're going to develop during this course.
In this course, you can journey through the many constraints that are built into the 2.0 version of the Bean Validation API, as well as the additional constraints provided by the Hibernate Validator 6.0. Learn Bean Validation in a practical way while you build a functioning web application. Instructor Alex Theedom shows how to extend the API with custom constraints and how to internationalize validation failure messages. Plus, learn advanced techniques such as cross-field and cross-parameter validation, and how Bean Validation integrates with other Java EE technologies such as JAX-RS, Java Persistence API (JPA), and JavaServer Faces (JSF). By the end of this course, you will have gained practical experience of using Bean Validation in a real web application and be able to implement what you have learned in your own Java applications.
- What is Bean Validation?
- Applying the built-in constraints
- Applying Hibernate constraints
- Designing custom constraint validators
- Managing and configuring validation failure messages
- Creating custom composite constraints
- Creating custom validation constraints
- Cross-field and cross-parameter validation
- Integration with RESTful web services (JAX-RS)