--- layout: default title: Apache Polygene ---
Let's create an example application. Open a terminal/console and type;
polygene create-project restapp Order my.domain.order
./gradlew assemble jettyRun
Open http://localhost:8080/app/api/ in browser. You will get the REST API root endpoint, showing Customers and Orders.
We can navigate to Customers http://localhost:8080/app/api/customers/
There are no Customers, but instructions how to create one.
Open a new terminal and let's create a Customer.
curl -u admin:secret -d name="Niclas Hedhman" http://localhost:8080/app/api/customers/create
We get back a confirmation that the Customer was created and the location of
$ echo '{ "name": "Niclas Hedhman",
"address": "Canary Residence",
"city": "Cheras",
"country": "Malaysia",
"phone": "" }' | curl http://localhost:8080/app/api
The simple Order domain model is found in Order/model/src/main/java/my/domain/order/model/orders
and we can see Customer.java
, Order.java
and OrderItem.java
public interface Order extends Identity
{
Property<String> orderNumber();
Association<Customer> customer();
ManyAssociation<OrderItem> items();
Property<ZonedDateTime> registered();
@Optional Property<ZonedDateTimeOpti shipped();
}
public interface OrderItem extends Identity
{
Property<String> partNumber();
Property<BigDecimal> unitPrice();
Property<Integer> units();
Property<BigDecimal> discount();
}
Join the dev@polygene.apache.org mailing list to discuss and get help.
You can also subscribe from here: SubscribeLearn more about problems Apache Polygene™ (Java Edition) tries to solve thanks to Composite Oriented Programming and how you can confidently develop domain centric applications with it.
Download the Apache Polygene™ (Java Edition) SDK binaries and sources, learn how to depend on Apache Polygene™ (Java Edition) in your build or simply get the source.
Get a grasp on Apache Polygene™ (Java Edition) in 42 minutes and then, get real through the first steps needed to get a complete application up and running. From there, work through the fundamentals of Apache Polygene™ (Java Edition) development with in-depth tutorials.
Everything you need to know about internals and how to use Apache Polygene™ (Java Edition). Runable samples, comprehensive documentation of the Apache Polygene™ (Java Edition) Core, Libraries, Extensions and Tools.