Kayıtlar

Ocak, 2019 tarihine ait yayınlar gösteriliyor

RPC or REST; Which one is best suited for your Web API ?

When we design an api for our software components, then a couple of confusing terms are just at the front of us.
Let's first cope with the conceptual confusion about the terms in this question.


What is an API ?API is the acronym for the Application Programming Interface.

It is a group of methods that is exported by a provider software components/modules and is supplied to its consumer software components/modulesand the messages(XML, JSON, etc.) of these method calls are transported accross the client and server sides.Web APIIn the context of web, an API is refered as a group of methods that is
the web protocol HTTP is used for the communication by transferring the messages, generally of the form; XML or JSON format.Okay then, if a consumer is using an API; then
it is communicating via a service providerwith dependency to a contract defined by the APIover some communication protocols such as HTTPand exchanging the messages in a structured formats such as XML, JSON etc.RPC or RPC style ?…

Spring Boot with H2

In this tutorial, we will examine the usage of the in-memory database h2 in a Spring Boot application.
H2 is an in-memory database, we can use it for simple case-studies and quick show cases.
Maven DependenciesThis can be easily generated with Spring Starter.
The dependency for Spring Data and JPA:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency>
The dependency for H2:
<dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency>H2 ConfigurationNow, we can configure the database settings in application.properties file:
spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.driverClassName=org.h2.Driver spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.datasource.username=sa spring.datasource.password=password spring.h2.console.enabled=trueThe last line is for…