blob: acb524d29a0cb6e0605a674c6eb06e81fb74a1c2 [file] [log] [blame]
---
layout: default
title: Apache Polygene
---
<div class="row-fluid">
<div id="home-logo" class="span3" style="text-align: center; padding-top: 132px">
<img src="graphics/Polygene-logo-234x137.png"/>
</div>
<div class="span9">
<div class="row-fluid">
<div class="span9">
<div class="well">
<h2>What is Apache Polygene™?</h2>
<p>
The short answer is that <strong>Apache Polygene™</strong> is a community based effort exploring Composite Oriented Programming for domain centric application development. This includes evolved concepts from <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Programming</a>, <a href="https://en.wikipedia.org/wiki/Dependency_injection">Dependency Injection</a> and <a href="https://en.wikipedia.org/wiki/Domain-driven_design">Domain Driven Design</a>.
</p>
<p>
<strong>Composite Oriented Programming</strong> allows developers to work with 'fragments', smaller than classes, and 'compose' fragments into larger 'composites' which acts like the regular objects. Apache Polygene™ also tackles the enforcement of application composition, i.e. composites are declared in modules, modules are contained in layers and access between layers are controlled/enforced.
</p>
<p>
<strong>Apache Polygene™ (Java Edition)</strong>, first Apache Polygene sub-project, is an implementation of Composite Oriented Programming, using the standard Java platform, without the use of any pre-processors or new language elements. Everything you know from Java still applies and you can leverage both your experience and toolkits to become more productive with Composite Oriented Programming today.
</p>
<p>
The Apache Polygene™ community welcomes any effort exploring Composite Oriented Programming for domain centric application development using any technology.
</p>
<!--
<p>Let's create an example application. Open a terminal/console and type;</p>
<code><pre>
polygene create-project restapp Order my.domain.order
./gradlew assemble jettyRun
</pre>
</code>
<p>Open <a href="http://localhost:8080/app/api/">http://localhost:8080/app/api/</a> in browser. You will get the REST API root endpoint, showing Customers and Orders.</p>
<p>We can navigate to Customers <a href="http://localhost:8080/app/api/customers/">http://localhost:8080/app/api/customers/</a></p>
<p>There are no Customers, but instructions how to create one.</p>
<p>Open a new terminal and let's create a Customer.</p>
<code><pre>
curl -u admin:secret -d name="Niclas Hedhman" http://localhost:8080/app/api/customers/create
</pre></code>
<p>We get back a confirmation that the Customer was created and the location of </p>
<code><pre>
$ echo '{ "name": "Niclas Hedhman",
"address": "Canary Residence",
"city": "Cheras",
"country": "Malaysia",
"phone": "" }' | curl http://localhost:8080/app/api
</pre>
</code>
<p>
The simple Order domain model is found in <code>Order/model/src/main/java/my/domain/order/model/orders</code>
and we can see <code>Customer.java</code>, <code>Order.java</code> and <code>OrderItem.java</code>
</p>
<code><pre>
public interface Order extends Identity
{
Property&lt;String&gt; orderNumber();
Association&lt;Customer&gt; customer();
ManyAssociation&lt;OrderItem&gt; items();
Property&lt;ZonedDateTime&gt; registered();
@Optional Property&lt;ZonedDateTimeOpti shipped();
}
</pre></code>
<code><pre>
public interface OrderItem extends Identity
{
Property&lt;String&gt; partNumber();
Property&lt;BigDecimal&gt; unitPrice();
Property&lt;Integer&gt; units();
Property&lt;BigDecimal&gt; discount();
}
</pre></code>
-->
</div>
</div>
<div class="span3">
<a href="http://www.apache.org" target="_blank"><img src="landing-resources/img/asf_logo.png"/></a>
<h3><i class="icon-group"></i> Get Help</h3>
<p>Join the <a href="https://www.apache.org/foundation/mailinglists.html" target="_blank">dev@polygene.apache.org</a> mailing list to discuss and get help<!--, or help others on <a href="http://stackoverflow.com/questions/tagged/apache-polygene">Stackoverflow</a>-->.</p>
You can also subscribe from here: <a href="mailto:dev-subscribe@polygene.apache.org" title="Click to subscribe to this list" style="margin: 0 auto" class="btn btn-primary">Subscribe</a>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<h3><i class="icon-briefcase"></i> Learn more</h3>
<p><a href="java/latest/intro.html">Learn more</a> 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.</p>
</div><!--/span-->
<div class="span6">
<h3><i class="icon-download"></i> Download</h3>
<p><a href="download.html">Download</a> the Apache Polygene™ (Java Edition) SDK binaries and sources, learn how to <a href="java/latest/howto-depend-on-polygene.html">depend on Apache Polygene™ (Java Edition) in your build</a> or simply get the <a href="community/codebase.html">source</a>.</p>
</div><!--/span-->
</div><!--/row-->
<div class="row-fluid">
<div class="span6">
<h3><i class="icon-time"></i> Get started</h3>
<p>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.</p>
<p><a href="java/latest/tutorials.html"><i class="icon-time"></i> View details &raquo;</a></p>
</div><!--/span-->
<div class="span6">
<h3><i class="icon-book"></i> Read the docs</h3>
<p>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.</p>
<p><a class="" href="java/latest/index.html"><i class="icon-book"></i> View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
</div>
</div><!--/row-->