EO - Elastic Objects Test Resource

Package for testing Elastice Objects

License

License

GroupId

GroupId

org.fluentcodes.projects.elasticobjects
ArtifactId

ArtifactId

eo-test-resources
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

EO - Elastic Objects Test Resource
Package for testing Elastice Objects
Project URL

Project URL

http://www.elasticobjects.com
Source Code Management

Source Code Management

https://github.com/fluentcodes/elasticobjects/

Download eo-test-resources

How to add to project

<!-- https://jarcasting.com/artifacts/org.fluentcodes.projects.elasticobjects/eo-test-resources/ -->
<dependency>
    <groupId>org.fluentcodes.projects.elasticobjects</groupId>
    <artifactId>eo-test-resources</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.fluentcodes.projects.elasticobjects/eo-test-resources/
implementation 'org.fluentcodes.projects.elasticobjects:eo-test-resources:0.1.2'
// https://jarcasting.com/artifacts/org.fluentcodes.projects.elasticobjects/eo-test-resources/
implementation ("org.fluentcodes.projects.elasticobjects:eo-test-resources:0.1.2")
'org.fluentcodes.projects.elasticobjects:eo-test-resources:jar:0.1.2'
<dependency org="org.fluentcodes.projects.elasticobjects" name="eo-test-resources" rev="0.1.2">
  <artifact name="eo-test-resources" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.fluentcodes.projects.elasticobjects', module='eo-test-resources', version='0.1.2')
)
libraryDependencies += "org.fluentcodes.projects.elasticobjects" % "eo-test-resources" % "0.1.2"
[org.fluentcodes.projects.elasticobjects/eo-test-resources "0.1.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.logging.log4j : log4j-core jar 2.5
org.fluentcodes.projects.elasticobjects : elastic-objects jar 0.1.2
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Open Source Helpers

A detailed documentation with interactive examples you find at elasticobjects.org.
This website is an example by itself. Its build by one generic spring boot endpoint and
EO template calls.

EO - Elastic Objects

Elastic Objects is a java framework using typed JSON for looseless communication with composed objects by one generic endpoint.

Functionality is provided by special call objects with a generic execution method using a source path as input and a target path for output.

Compared with todays RPC concepts its more a "Remote Object Call" (ROC) architecture. One can easily create new calls for almost anything. A client can create a typed JSON message addressing call objects in any combination.

There are some predefined generic calls e.g. for files, csv, Excel, database or templates. The calls implemented are used in the two applications:

Elastic Objects

Elastic Objects is a generic object wrapper skin with typed path methods to an java object skeleton. Typed objects are embedded in an untyped map structure.

Some code examples you will find in http://elasticobjects.org/eo/EO.html.

Model Configurations

For the access to the embedded java objects EO is provided by preloaded model configurations in JSON.

Call Types

A special Call bean with a generic execution method offers functionality. Its has the following important fields:

Pseudo JSON Example

The following pseudo code would call the execute method in the ACall instance, which uses the AnObject object provided in input path and store the result in target path.

{
    "(AnObject)input":{...},
    "(ACall)target:{"sourcePath":"input"}
}

A CSV Example

This example is executable on elasticobjects.org.

{
"data": {
    "(CsvSimpleReadCall)csv":{
         "configKey"="AnObject.csv"
    },
    "(TemplateResourceCall)abc":{
        "configKey":"table.tpl",
        "sourcePath":"/data/csv",
        "targetPath":"/_asTemplate"
    }
},
"asTemplate":true
}

Elements

≡TemplateResourceCall is part of the core module. Templates are just files with certain placeholders .

Sending Template

The following example is executable on elasticobjects.org

<h1>An Example Template</h1>

<h2>CSV</h2>
==>{CsvSimpleReadCall->AnObject.csv, data/csv}.
==>{TemplateResourceCall->table.tpl, data/csv}.

<h2>Excel</h2>
==>{XlsxReadCall->AnObject.xlsx:test, data/xlsx}.
==>{TemplateResourceCall->table.tpl, data/xlsx}.

<h2>DB</h2>
==>{DbSqlReadCall->h2:mem:basic, h2:mem:basic:AnObject, data/db}.
==>{TemplateResourceCall->table.tpl, data/db}.

Short Form

In the template a short form of one call JSON is used:

 ==>{CsvSimpleReadCall->AnObject.csv, data/csv}.

is equivalent to

===>{"(CsvSimpleReadCall)":{
     "fileConfigKey":"AnObject.csv",
     "targetPath":"data/csv"     
}}.

and

==>{TemplateResourceCall->table.tpl, data/csv}.

is equivalent to

===>{"(TemplateResourceCall)":{
     "fileConfigKey"="table.tpl",
     "sourcePath": "data/csv"    
}}.

Elements

On elasticobjects.org a second endpoint is defined for receiving templates via WebEo.java.

After each read call the AnObject example data a TemplateResourceCall will render this data with table.tpl again.

Other Examples

Service Examples

Under http://elasticobjects.org/examples/ExamplesStart.html you find further working editable service examples:

Direct Java Usage

Under the http://elasticobjects.org/eo/EO.html you find examples to use EO in a java code context.

Conclusion

The project has now version 0.8.1 and it's good enough for a proof of concept. For the hyped microservice architectures it would offer an incredible flexibility compared with RPC API solutions.

Modules

Actually three modules are deployed to Maven Central.

elastic-objects

The core has actually no dependencies beside Log4j
and is rather small with a jar size of approximately 270 KB. It already includes the template calls.

    <dependency>
        <groupId>org.fluentcodes.projects.elasticobjects</groupId>
        <artifactId>elastic-objects</artifactId>
        <version>0.8.0</version>
    </dependency>

elastic-objects-test

The objectives elastic-objects-test is providing all tests for elastic-object module together with a main package providing test helper and test objects to other modules.

examples-springboot

examples-springboot are the sources for the spring boot web example on http://www.elasticobjects.org.

eo-csv

eo-csv offers calls and configurations for reading and writing csv files using OpenCsv.

<dependency>
    <groupId>org.fluentcodes.projects.elasticobjects</groupId>
    <artifactId>eo-csv</artifactId>
    <version>0.8.0</version>
</dependency>

<div align="right" style="font-size:10px">
mvn repository

eo-db

eo-db is provide the execution of some sql configurations as list or as query.

eo-xlsx

eo-xlsx offers calls and configurations for reading and writing xlsx files using Apache POI.

<dependency>
    <groupId>org.fluentcodes.projects.elasticobjects</groupId>
    <artifactId>eo-xlsx</artifactId>
    <version>0.8.0</version>
</dependency>

builder

builder offers calls and configurations
for generating sources like java classes or json configuration by a simple Excel file.

top

Links

Versions

Version
0.1.2
0.1.0