-
Notifications
You must be signed in to change notification settings - Fork 23
/
intro.html
124 lines (108 loc) · 6.65 KB
/
intro.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"-->
<link rel="stylesheet" href="/gfx/bootstrap.min.css">
<link rel="stylesheet" href="/gfx/main.css">
<link rel="stylesheet" href="/gfx/code.css">
<title>Inception</title>
</head>
<body class="page">
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-PMJSKV"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PMJSKV');</script>
<!-- End Google Tag Manager -->
<header>
<div class="container">
<a href="/">Immutables</a> ←
<h1>Inception <iframe src="https://ghbtns.com/github-btn.html?user=immutables&repo=immutables&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
</h1>
</div>
</header>
<aside id="toc"></aside>
<section class="documentation">
<h2 id="inception">Inception</h2>
<p>Here’s some background:</p>
<ul>
<li>Read “Item 15: Minimize mutability” <a href="http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683">Effective Java, Second Edition</a>
book for a classic summary on immutability.</li>
<li>See Google’s attempt on this with <a href="https://docs.google.com/presentation/d/14u_h-lMn7f1rXE1nDiLX0azS3IkgjGl5uxp5jGJ75RE">AutoValue</a>.</li>
<li>Watch <a href="http://www.infoq.com/presentations/Value-Objects-Dan-Bergh-Johnsson">“Power Use of Value Objects” presentation</a> for examples of how useful value objects are.</li>
<li>Watch <a href="http://www.infoq.com/presentations/Simple-Made-Easy">“Simple made easy” presentation</a> about some insights on simplicity of immutability.</li>
</ul>
<p>The <em>Immutables</em> package has been in development since early 2012, counting from earliest prototypes.
Currently, the toolkit is being used successfully in production applications:
It is used for the development of airline inventory systems, travel deal aggregators, and other applications that take advantage of efficient in-memory storage and concurrent computations on the JVM.</p>
<p><a href="https://code.google.com/p/guava-libraries">Guava</a> is used as an optional utility library for the generated classes,
but in addition we employ an API style popularized by the “Effective Java, Second Edition” book and Guava Library.
Use of <code class="language-plaintext highlighter-rouge">null</code> as an attribute value is rigorously prohibited (<a href="https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained">Using and avoiding null explained</a>).</p>
<p>The <em>Immutables</em> package does not use compiler hacks with AST transformations or companion languages: It uses annotation processing - a part of the standard Java compiler.
Classes are generated during the compilation process and are not stored in source control, but the generated sources are easily inspected if necessary.
Generated code can extend user written code, but the two are never mixed in one file!</p>
<p>It may seem that the use of <em>Immutables</em> may result in some sort of <a href="http://www.martinfowler.com/bliki/AnemicDomainModel.html">anemic domain model</a>.
However, this impression is false - we see great benefits in the process of proper domain modelling. But we need solid building blocks — value objects,
<a href="/immutable.html#smart-data">smart data</a> objects,
and immutable values containing methods that compute other values and reduce the complexity of services and entities.</p>
<p>Another aspect of modelling is the representation of system state and domain entities as sequences of <em>events</em> or <em>snapshots</em>.
Techniques such as <a href="http://martinfowler.com/eaaDev/EventSourcing.html">event sourcing</a> reap the
benefits of immutable object graphs, such as allowing sub-graphs to be shared between snapshots, transformations of system states,
or even the full reconstruction of the state of a system at some point in time.
For that kind of system, we just made writing immutable objects a whole lot easier.</p>
<p>The <em>Immutables</em> annotation processor is useful for increasing safety and consistency at application boundaries (as well as in internal data structures),
and creating expressive data objects for your Java API.</p>
</section>
<footer class="jumbotron">
<div class="container">
<h2 id="guides">Guides</h2>
<ul>
<li><a href="/getstarted.html">Get started!</a></li>
<li><a href="/intro.html">Inception</a></li>
<li><a href="/immutable.html">Immutable objects</a></li>
<li><a href="/factory.html">Factory builders</a></li>
<li><a href="/functional.html">Functions and Predicates (for Java 7)</a></li>
<li><a href="/style.html">Style customization</a></li>
<li><a href="/json.html">JSON serialization</a></li>
<li><a href="/criteria.html">Criteria</a></li>
<li><a href="/mongo.html">MongoDB repositories</a></li>
<li><a href="/dynamodb.html">DynamoDB integration</a></li>
<li><a href="/encoding.html">Encoding: Customizing attributes and builders (experimental)</a></li>
<li><a href="/apt.html">Using annotation processor in IDE</a></li>
</ul>
<h2 id="get-involved">Get involved</h2>
<ul>
<li>Clone source repository, contribute bug reports and fixes on <a href="https://github.com/immutables/immutables">GitHub immutables/immutables</a></li>
<li>Issue reports, questions and feedback is welcome on issue tracker <a href="https://github.com/immutables/immutables/issues">GitHub immutables/immutables/issues</a></li>
<li>News and announcements on twitter <a href="https://twitter.com/ImmutablesOrg">@ImmutablesOrg</a></li>
</ul>
<p><a href="/license.html">Apache License 2.0</a></p>
<!--<div><h2>Posts</h2>
<ul>
</ul>
</div>-->
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script defer src="/gfx/jquery.toc.min.js"></script>
<script>
$(function() {
$('#toc').toc({
container: '.documentation',
selectors: 'h1,h2,h3,h4',
anchorName: function(i, heading, prefix) {
heading = $(heading).text();
if (heading.trim) heading = heading.trim();
return heading.toLowerCase().replace(/ /g, '-').replace(/[^a-z^\-]+/g, '');
},
})
})
</script>
</body>
</html>