Book Image

Easy Web Development with WaveMaker

By : Edward Callahan
Book Image

Easy Web Development with WaveMaker

By: Edward Callahan

Overview of this book

Developers of all levels can now easily develop custom, responsive, and rich web application clients with secure, scalable servers utilizing relational databases and RESTful services using WaveMaker Studio. Whether you need a departmental business application or a form application for your weekend club, this book will show you how to design, develop, and deploy professional grade web applications with WaveMaker. Easy Web Development with WaveMaker will help you use WaveMaker to design, develop, and deploy rich, responsive web applications, even if you are not a programmer. If you need to build a data-driven web application, but you only know ‘enough to be dangerous,' you need this book. This book examines every angle of using WaveMaker to build applications, from dissecting examples to customizing, deploying, and debugging your own applications. This book enables the non-professional programmer to become comfortable not only with using WaveMaker Studio itself, but also with the artefacts produced by the studio as well as the runtime and services provided by the WaveMaker framework. You will learn everything, from how customize the user experience with JavaScript and CSS to integrating with custom Java services and the Spring Framework server-side. Easy Web Development with WaveMaker 6.5 is packed with examples, code samples, screenshots, and links to equip you to be successful with WaveMaker Studio.
Table of Contents (23 chapters)
Easy Web Development with WaveMaker
About the Author
About the Reviewers
Styling the Application
Working with Databases
Utilizing Web Services

Dependency injection

Now that we've seen how useful other service beans can be in our Java code, let's make it easier to get to those services. The best way to get an instance of the runtime bean, or any other project bean, is to "inject" it into the service class using dependency injection.

Dependency injection is when the bean declares a dependency and the container (for example, Tomcat and Spring) provides or injects that dependency to the bean as part of its initialization. The benefit is that the property is populated for us by the container. We do not need to fetch an instance of the service in code.

In our example, DbOpsSvc from the JavaServices project, we also inject runtimeService into our service class. The updateCustomerInjected() method repeats the updateCustomer() example function but using dependency injection.

The runtime service has the bean ID of runtimeService. We can confirm the bean ID for any bean by examining that service's spring.xml file. In the case of the runtime...