Project

General

Profile

Wiki » History » Version 37

Henning Blohm, 06.02.2015 10:51

1 1 Henning Blohm
h1. Intro
2
3 2 Henning Blohm
This project is for the development of [[z2-environment:wiki|z2-environment]] version 3.0.
4 1 Henning Blohm
5 2 Henning Blohm
Version 3.0 is a major refactoring release of z2 with new repository code lines and complete package renaming.
6 1 Henning Blohm
7 36 Henning Blohm
Check out the roadmap at "roadmap":https://redmine.z2-environment.net/versions/27
8
9 2 Henning Blohm
h1. Essential Differences between v2.3 and v3.
10 1 Henning Blohm
11 2 Henning Blohm
* All the typical declarations and package names are no longer *com.zfabrik.<something>* but rather *org.z2env.<something>*
12 13 Henning Blohm
* The <z2 home> layout is completely new and more flexible
13 3 Henning Blohm
* The essential component types that can be _invoked_ from the core is *system state* and *main program*.
14 14 Henning Blohm
* While Jetty is still contained to support Eclipsoid and z2Unit, we support a pre-installed Tomcat as application container (and with TomEE would even get a Java EE profile)
15 1 Henning Blohm
* The core is lighter and more dedicated. 
16 12 Henning Blohm
* There will be substantially less built-in application support like
17
** a local JTA implementation 
18
** No worker suppport without a corresponding add-on.
19 1 Henning Blohm
20 12 Henning Blohm
The main task of v3 is:
21 13 Henning Blohm
* Make the lower parts of z2 more accessible and easier to understand: While z2 previously started System Centric, we now close the gap from the ordinary main program.
22 12 Henning Blohm
* Increase the OSS flavor of z2
23 15 Henning Blohm
24
Obvious TODOs:
25
* Test TomEE
26
* Fix Eclipsoid templates
27
* Support MVNCR, also for distributions
28 12 Henning Blohm
29 9 Henning Blohm
h1. Draft Intro Documentation
30 1 Henning Blohm
31 2 Henning Blohm
h2. Getting Started
32 1 Henning Blohm
33 2 Henning Blohm
To understand how z2 works, you need to understand at most what are z2 modules and components and what are component repositories and how these concepts interplay. 
34 1 Henning Blohm
35 6 Henning Blohm
Check out [[wiki#Understanding-Z2|understanding-z2]] for that.
36 1 Henning Blohm
37 2 Henning Blohm
It is simplest to start by running a simple Java main program in z2 or a simple Web App. 
38 1 Henning Blohm
39 2 Henning Blohm
Follow this trail:
40 1 Henning Blohm
41 4 Henning Blohm
* [[wiki#Building-z2env-core|Building the core]]
42 7 Henning Blohm
* [[wiki#Running-a-Hello-World-main-program|Running a Hello World main program]]
43 10 Henning Blohm
* [[wiki#Running-a-Hello-World-Web-App|Running a Hello World Web App]]
44 22 Henning Blohm
* [[wiki#Developing-with-Eclipse-or-IntelliJ|Developing with Eclipse or IntelliJ]]
45 32 Henning Blohm
* [[wiki#Going-Multi-Module|Going Multi Module]]
46 1 Henning Blohm
47 22 Henning Blohm
48
49 3 Henning Blohm
h2. Building z2env-core
50 1 Henning Blohm
51 17 Henning Blohm
(For now, we need to build the core).
52
53
h3. Pre-requisites
54
55
* You need Git installed
56
* You need a JDK, at least version 7
57
* You need the ANT build tool
58
59 3 Henning Blohm
First clone http://git.z2-environment.net/z2env.core
60
61
<pre>
62
git clone http://git.z2-environment.net/z2env.core
63
</pre>
64
65 25 Henning Blohm
Change into *org.z2env.core.main* and run 
66 3 Henning Blohm
67
<pre>
68 18 Henning Blohm
ant -Doutput=<z2home> -Dsetup=<setup> 
69 3 Henning Blohm
</pre>
70
71 18 Henning Blohm
where <z2home> is where you want to install z2 (the *z2 home* that is) and <setup> is a choice of pre-configured content, actually component repositories.
72 3 Henning Blohm
73
If you omit *output* it will default to *gen/dist*. If you omit *setup*, no content will be pre-configured will be modified. 
74
75
Check the folder *setups* for available setups of the core build. These can be local (all repos will be cloned locally) or remote (repos will be remoted).
76
77 1 Henning Blohm
In general this build always updates only boot, z.jar, roots. It will not remove anything.
78
79 18 Henning Blohm
80 3 Henning Blohm
Example to install/update a core only into ../../z2env:
81
82
<pre>
83 24 Henning Blohm
ant -Doutput=../../z2env 
84 3 Henning Blohm
</pre>
85
86 1 Henning Blohm
To install/update a web-basic setup (with tomcat and eclipsoid support) with updates from remote repos:
87
88
<pre>
89 3 Henning Blohm
ant -Doutput=../../z2env -Dsetup=web-basic-remote
90
</pre>
91 19 Henning Blohm
92
Check out [[wiki#Understanding-the-ltHOMEgt|Understanding the <HOME>]] to learn more about the generated structure.
93
94 7 Henning Blohm
95
h2. Running a Hello World main program
96
97
For now, we will assume you have a z2 core installed in <HOME>. In its purest form, all the core can actually execute is simple Java main programs. 
98
99
Being in a modular environment, even if we only want to say „Hello World“, we need a module. Let's call it the greeter module. In order to have a main program run by z2, we need to also declare a  component for it, as that is what we tell z2 to run (not a class – mind you – but rather a component in a module). Assuming we use the local component name hello, than the absolut component name is 
100
101
<pre>
102
greeter/hello
103
</pre>
104
105
Finally, as this component actually has implementation code, we need to declare a Java component. By convention this is 
106
107
<pre>
108
greeter/java
109
</pre>
110
111 37 Henning Blohm
Now, after installing in <HOME> the place to simply drop a module is under <HOME>/modules. You might need to create that folder.
112
113
All in all, here is the complete structure to create:
114 7 Henning Blohm
115
| <HOME>/modules/greeter/hello.properties | 
116
<pre><code class="ruby">org.z2env.component.type=org.z2env.main
117
component.className=greetings.Main
118
</code></pre> |
119
| <HOME>/modules/greeter/java/z.properties | 
120
<pre><code class="ruby">org.z2env.component.type=org.z2env.java
121
</code></pre> |
122
| <HOME>/modules/greeter/java/src.impl/greetings/Main.java |
123
<pre><code class="java">
124
package greetings;
125
126
public class Main {
127
  public static void main(String[] args) {
128 8 Henning Blohm
    System.out.println("Hello!");
129 7 Henning Blohm
  }
130
}
131
</code></pre> |
132
133
That gives us the two components of module greeter. To run this on the command line, run
134
135
<pre>
136
java -DcomponentName=greeter/hello -jar z.jar
137
</pre>
138
139 1 Henning Blohm
Now, obviously this sample is not worth a modular execution environment. But even from here, you could check your module in with some Git repository that is referenced from the roots and all other users of the same repo would be able to run your component without installing anything.
140 10 Henning Blohm
141
h2. Running a Hello World Web App
142
143 11 Henning Blohm
This introduction explains how to connect a z2 core to a given Tomcat installation and how to develop a simple Web Application.
144 7 Henning Blohm
145 11 Henning Blohm
Furthermore it describes how to use the Dev Repository and the Eclipsoid plugin for the Eclipse or the IntelliJ development environment.
146
147
h3. Pre-Requisites
148
149
* We assume a development workspace in *workspace*.
150
* Have a local Tomcat (7 or higher) installation.*
151
152
h3. Steps we are going to take
153
154
# Create a module with a simple Web app
155
# Make it visible to Z2
156
# Run the Web App in a Tomcat Web Container
157
158
At first get yourself a z2env core with the *web-basic-local* or *web-basic-remote* setup. Make sure it is in your *workspace*. If you follow [[wiki#Building-z2env-core|Building the core]] this means running 
159
160
<pre>
161
ant -Doutput=workspace/z2env -Dsetup=web-basic-remote
162
</pre>
163
164 26 Henning Blohm
(*Note:* If in doubt, use an absolute path for *workspace*)
165 1 Henning Blohm
166 26 Henning Blohm
Using your IDE create a new project *hello* in *workspace* with the following structure:
167 11 Henning Blohm
168
| java/z.properties | 
169
<pre><code class="ruby">
170
org.z2env.component.type=org.z2env.java
171
java.privateReferences=\
172
	javax.servlet
173
</code></pre> |
174
| web/z.properties |
175
<pre><code class="ruby">
176
org.z2env.component.type=org.z2env.tomcat.webapp
177
webapp.path=/hello
178
</code></pre> |
179
| web/WebContent/index.jsp |
180
<pre><code class="html"><html><body>Hello! Did you know that 7*7=<%=7*7%>?</body></html></code></pre> |
181
| LOCAL | <empty file> |
182
183 20 Henning Blohm
Your *workspace* folder now contains two subfolders *z2env* and *hello*.
184
185 11 Henning Blohm
So far, that's it.  We will touch on the LOCAL file later. 
186
187
When we run Z2 knowing this Web Application, it will attempt to start a Tomcat Web Container that will serve the application's content. To do that, it needs to find one. 
188
189
In order to tell Z2 where to look, you can either set an environment variable *CATALINA_HOME* (you might have already – it's the Tomcat standard) or specify an environment variable *catalina.home*. 
190
191
To be on the safe side and assuming the location is */home/me/tomcat*, we open a terminal, change into *workspace/z2env* and run
192
193
<pre>
194
java -Dcatalina.home=/home/me/tomcat -jar z.jar hello/web
195
</pre>
196
197
Note, unlike for the main program, the command line will not return. Instead you can enter „q“ to quit or „s“ to synchronize. But first let's open a browser and check out 
198
199
<pre>
200
http://localhost:8080/hello
201
</pre>
202
203 28 Henning Blohm
*Note:* What you just created is a prototypical z2 module structure containing a Java component *java* (holding implementation) and a Web component *web*. 
204 1 Henning Blohm
205 28 Henning Blohm
Instead of creating the structure yourself, you could use the Eclipsoid plugin (introduced below) for that:
206
* In Eclipse: New / Others / new z2...., 
207
* In IntelliJ: New / Module / z2....
208 1 Henning Blohm
209 28 Henning Blohm
... but beware of the pre-generated configuration. Where it says *com.zfabrik* change to *org.z2env*.
210 27 Henning Blohm
211 28 Henning Blohm
212
*Note:* Now on to that LOCAL file. Unlike for the Hello World main program, this time it was to so-called Dev Repo that made our module available to z2. 
213 11 Henning Blohm
214
The dev repo is a key component to the development approach with z2. It checks for all modules that have a LOCAL file and that are stored some levels deep, relative to the parent folder of the z2 home (by default), which not so coincidentally is our workspace.
215
216
Try this: 
217
218
# Remove LOCAL
219
# Enter „s“ for synchronization. 
220
# Check the URL above (should say „not found“)
221
# Create a LOCAL file again
222
# Synchronize
223
# Check again.
224 1 Henning Blohm
225 11 Henning Blohm
Similarly, from now on, changes made to the hello module will be picked up, whenever you synchronize.
226 1 Henning Blohm
227 22 Henning Blohm
h2. Developing with Eclipse or IntelliJ
228 1 Henning Blohm
229 21 Henning Blohm
In this section we will add some code to the hello Web app and see how to develop using an integrated development environment like the Eclipse IDE or Jetbrains' IntelliJ IDEA.
230 1 Henning Blohm
231 21 Henning Blohm
h3. Pre-Requisite
232 1 Henning Blohm
233 21 Henning Blohm
* Have an Eclipse or IntelliJ installation
234
* Install the Eclipsoid plugin from http://z2-environment.net/eclipsoid/update/site.xml or by searching for "z2" in the IntelliJ Plugin Repository respectively
235
236
h3. Steps we are going to take
237
238
# Complete the development workspace setup
239
# Add a simple Controller
240
241
h4. In Eclipse
242
243
Use the workspace *workspace*. Create a Java project *hello* where we created the *hello* module. That is, we use the existing module as project content. You should now have an Eclipse development workspace that has one Java project named "hello". Right-click on the project and choose "Transform into z2 Project". A small "Z" icon should not decorate the project icon. 
244
245 30 Henning Blohm
Add a source folder *java/src.impl* to the project.
246
247 21 Henning Blohm
Try "Arm Z2 Projects" and "Disarm Z2 Projects" from the context menu. You should see a LOCAL file showing up and disappearing as well as the "Z" decoration showing a green halo and going back to normal. 
248
249
Go into Window/Preferences, pick "z2-Environment". Change the port to 8081, set the user to "z*" and the password to "z". Done.
250
251
h4. In IntelliJ
252
253 30 Henning Blohm
Add a source folder *java/src.impl* to the module.
254
255 21 Henning Blohm
Start a new Project with root folder *workspace*. Press the "Manage z2-Modules" button in the toolbar. Import the *hello* module into your IntelliJ project. Open the Settings dialog, pick "z2-Environment". Change the port to 8081, set the user to "z*" and the password to "z". Done.
256
257
h4. IDE Indepently
258
259
Start z2 as in the previous section but make sure the development support is enabled. Use this command line:
260
261
<pre>
262
java -Dcatalina.home=/home/me/tomcat -jar z.jar org.z2env.dev.shared/ready hello/web
263
</pre>
264
265
(possibly you want to turn this into a shell script)
266
267 23 Henning Blohm
*Note:* The _system state_ *org.z2env.dev.shared/ready* will pull up all necessary development support components. Make sure this is part of your to-be-run list.
268 1 Henning Blohm
269 29 Henning Blohm
270 1 Henning Blohm
Regardless whether you are using Eclipse or IntelliJ, press the "Resolve Classpath from Z2" button in the toolbar. This will make sure that all required dependencies for Z2 modules, as far as Java code is concerned, will be resolved for your workspace. 
271 29 Henning Blohm
272 30 Henning Blohm
Now add a class *SimpleController* and change the following files:
273 21 Henning Blohm
274 22 Henning Blohm
| java/src.impl/hello/SimpleController.java | 
275 21 Henning Blohm
<pre><code class="java">
276
package hello;
277
278
import javax.servlet.*;
279
import javax.servlet.http.*;
280
import java.io.IOException;
281
282
public class SimpleController extends HttpServlet {
283
284
    @Override
285
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
286
        String input = req.getParameter("input");
287
        if (input!=null && input.trim().length()>0) {
288
            req.setAttribute("output","You said: "+input);
289
        }
290
        req.getRequestDispatcher("/").forward(req,resp);
291
    }
292
}
293
</code></pre> |
294
| java/z.properties | 
295
<pre><code class="ruby">
296
org.z2env.component.type = org.z2env.java
297
298
java.privateReferences=\
299
  javax.servlet,\
300
  javax.servlet.jsp.jstl
301
</code></pre> |
302
| web/WebContent/WEB-INF/web.xml | 
303
<pre><code class="xml">
304
<?xml version="1.0" encoding="UTF-8"?>
305
<web-app id="hello" version="2.5"
306
		xmlns="http://java.sun.com/xml/ns/javaee"
307
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
308
		xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
309
310
    <servlet>
311
        <servlet-name>controller</servlet-name>
312
        <servlet-class>hello.SimpleController</servlet-class>
313
    </servlet>
314
    
315
    <servlet-mapping>
316
        <servlet-name>controller</servlet-name>
317
        <url-pattern>/do</url-pattern>
318
    </servlet-mapping>    
319
</web-app>
320
</code></pre> |
321
| web/WebContent/index.jsp |
322
<pre><code class="html">
323
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core_1_1" %>
324
<html>
325
<body>
326
  <c:if test="${not empty output}">
327
    <p><c:out value="${output}"/></p>
328
  </c:if>
329
  <form method="POST" action="<c:url value='/do'/>">
330
    Input: <input type="text" name="input"><input type="submit" value="go!">
331
  </form>
332
</body>
333
</html>
334
</code></pre>|
335
336
Make sure the *hello* module is armed (right-click) by having a LOCAL file.
337
338
Now synchronize your running z2 by either:
339
340
* Pressing the "Sync with z2-Environment" button in the toolbar
341
* Pressing ALT+y in your IDE
342
* Entering "s" on the command line running z2.
343
344
Go to http://localhost:8080/hello and check it out.
345
346
347
h2. Going Multi-Module
348 12 Henning Blohm
349 31 Henning Blohm
In this section we will extend the previous work by a simple service module. 
350
351
h3. Pre-Requisites
352
353
# Have all the results from the previous section ready.
354
# Start IDE and z2 as above.
355
356
357
h3. Steps we are going to take
358
359
# add a new module with a service API
360
# reference the module API from the *hello* module and invoke the service.
361
362
363
In your workspace, use Eclipsoid to create a new z2 Java module *goodbye*. Open *java/z.properties* and change all *com.zfabrik.* prefixes to *org.z2env*. Essentially the file only needs the line
364
365
<pre><code class="ruby">
366
org.z2env.component.type=org.z2env.java
367
</code></pre>
368
369
In our API we will only expose an interface and rather leave the implementation hidden in the implementation parts of the module. We do that, as we prefer a strong separation of API and implementation. This is not at all required but a conscious design choice. 
370
371
372
| java/src.api/goodbye/GoodbyeService.java | 
373
<pre><code class="java">
374
package goodbye;
375
376
public interface GoodbyeService {
377
378
	String sayGoodbye(String in);
379
	
380
}
381
382
</code></pre> |
383
| java/src.impl/goodbye/GoodbyeServiceImpl.java | 
384
<pre><code class="java">
385
package goodbye;
386
387
public class GoodbyeServiceImpl implements GoodbyeService {
388
389
	@Override
390
	public String sayGoodbye(String in) {
391
		return "Goodbye "+in+"!";
392
	}
393
394
}
395
</code></pre> |
396
| java/service.properties | 
397
<pre><code class="ruby">
398
org.z2env.component.type=org.z2env.any
399
component.className=goodbye.GoodbyeServiceImpl
400
</code></pre> |
401
| java/z.properties | 
402
<pre><code class="ruby">
403
org.z2env.component.type=org.z2env.java
404
</code></pre> |
405 1 Henning Blohm
406 32 Henning Blohm
In effect we created the following:
407
408
* A module *goodbye* that has 
409
* A Java component with API and Implementation source code
410
* An _any_ component *goodbye/service* that manages the service implementation (as we will see below)
411
412
Back in the *hello* module, we want to use the _goodbye service_. We apply the following changes:
413
414
| java/z.properties | 
415
<pre><code class="ruby">
416
org.z2env.component.type=org.z2env.java
417
418
java.privateReferences=\
419
    javax.servlet,\
420
    javax.servlet.jsp.jstl,\
421
    goodbye
422
</code></pre> |
423 33 Henning Blohm
| java/src.impl/hello/SimpleController.java | 
424 32 Henning Blohm
<pre><code class="java">
425
package hello;
426
427
import goodbye.GoodbyeService;
428
429
import java.io.IOException;
430
431
import javax.servlet.ServletException;
432
import javax.servlet.http.HttpServlet;
433
import javax.servlet.http.HttpServletRequest;
434
import javax.servlet.http.HttpServletResponse;
435
436
import org.z2env.components.IComponentsLookup;
437
438
public class SimpleController extends HttpServlet {
439
440
    @Override
441
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
442
    	GoodbyeService gb = IComponentsLookup.CL.lookup("goodbye/service", GoodbyeService.class);
443
        String input = req.getParameter("input");
444
        if (input!=null && input.trim().length()>0) {
445
            req.setAttribute(
446
        		"output",
447
        		gb.sayGoodbye(input)
448
        	);
449
        }
450
        req.getRequestDispatcher("/").forward(req,resp);
451
    }
452
}
453
</code></pre> |
454
455
After you have changed the Java references in *java/z.properties* you might want to press Alt-R or the "Resolve Classpath from Z2" button in the toolbar to have the IDE resolve the dependency for the *goodbye* module and so that
456
your IDE will not complain about using the *GoodbyeService* interface.
457
458
Now synchronize your running z2 by either:
459
460
* Pressing the "Sync with z2-Environment" button in the toolbar
461
* Pressing ALT+y in your IDE
462
* Entering "s" on the command line running z2.
463
464
Go to http://localhost:8080/hello and check it out.
465 31 Henning Blohm
466 34 Henning Blohm
h3. Discussion
467 31 Henning Blohm
468 34 Henning Blohm
What you just implemented is a programmatic component lookup. The first time <code>IComponentsLookup.CL.lookup("goodbye/service", GoodbyeService.class)</code> was invoked, z2 searched for a factory for *org.z2env.any* components. This specific factory simply created a singleton instance of the Goodbye Service and checked whether the requested interface is implemented. As that held, it returned the actual instance.
469
470
In later sections (for now check out [[z2-environment:How_to_Spring]]) we will explain how to that extends to the Spring Framework and Dependency Injection in general.
471 12 Henning Blohm
472 35 Henning Blohm
Feel free to apply changes to the Goodbye Service implementation class and have them made effective by synchronizing Z2.
473
474 12 Henning Blohm
h2. Going System-Centric
475
476
TBD
477
478
Getting more real by adding a remote repo as system repo.
479
480
Develop by checking out modules and using the Dev Repo.
481 3 Henning Blohm
482 1 Henning Blohm
483 3 Henning Blohm
h2. Understanding the <HOME>
484 1 Henning Blohm
485 18 Henning Blohm
We call an installation of a z2env core a *<home>*. The file structure of the *<home>* consists of few but important locations
486 3 Henning Blohm
487 18 Henning Blohm
h3. Layout
488
489 3 Henning Blohm
| z.jar | The actual core implementation. This is precompiled.|
490
| boot/ | A component repository adding to the core and provides the most basic capabilities such as compiling Java code and running a main program. |
491
| roots/ | A file system component repository that is always registered by the core. This is typically filled with other repository components linking to remote or local component repositories. |
492 1 Henning Blohm
| modules/ | A file system repository declared under roots/ that is useful to locally augment a core installation.|
493
494
We use the modules repository for example for command line experiments and simple hacks. It is not as useful for regular development operations as is the dev repo.
495 18 Henning Blohm
496
h3. Folders and Properties
497
498
When running z2 from the command line, some logic is applied to derive where stuff is and some defaults apply:
499
500
|_. What |_. System property |_. Defaults |
501
| Z2 home - the installation location | org.z2env.home | If no system property is set, the environment variable Z2_HOME will be checked. If that is not set, the z2 home location will be derived from the location of the z.jar file |
502
| Dev Repo workspaces - where the Dev Repo checks for local modules | org.z2env.dev.local.workspaces | Defaults to ${z2.home}/.. assuming modules will be next to the home or one level deeper |
503
504 5 Henning Blohm
505
h2. Understanding Z2
506
507
Most of the concepts that make up z2 can be derived from the desire to efficiently develop standard Java Web Applications that are defined in a central system definition. Add to that the wish to avoid all that build complexity and the desire for a practically usable modularization approach.
508
509
Once you loose the ability to tweak some build script or configuration to describe how to package a Web app or some libraries, you need some structural hint and simple declarations providing sufficient information.
510
511
Secondy, assuming you want to apply changes at runtime, you need some way of determining what to unload at runtime, given some changed file. Again: Structural information needs to present that maps to runtime state. 
512
513
Finally, as we want some support for modular application development anyway, why not make modules our essential structure. As we have not only code but also Web Applications, Data Sources,  Background Jobs and much more to consider, we add components with type into the mix. Voila.
514
515
*Component Repositories* provides modules and components to z2. A component is prefixed by the module name:
516
517
<pre>
518
<global component name> = <module name>/<local component name>
519
</pre>
520
521
In fact, the typical component repository has a file system style structure that is made up exactly like that. 
522
523
Structure from repo root:
524
525
| /<module>/<cmp>.properties | A component <cmp> in module <module> that has no resources on its own.|
526
| /<module>/<cmp>/z.properties | A component <cmp> in module <module> that may have additional resources on its own.|
527
528
Note that some components, like Web applications and typically Java components have file resources, such as HTML files or Java source code files, while other components, such as main program declarations or data source declarations, so not.
529
530
There are some conventions around this naming scheme. In particular, by convention, whenever a component requires Java implementation, z2 will first look for a component named *java* of the same module. As for example in the Hello World example.
531
532
To give you an idea what this model translates to at runtime consider this: At runtime, the static component is turned into a Resource instance by a component type implementation (that, in fact, is provided by another, built-in component type). 
533
534
!uml1.png!
535
536
Dependencies, for example those between Java components, translate into dependencies between resources that are observed during invalidation of resources. This introduces invalidation and synchronization.
537
538 16 Henning Blohm
h3. A crucial concept of z2 is that of a synchronization. 
539 5 Henning Blohm
540
For fast development roundtrips and in some cases for general configuration updates, it is desirable to not require a complete restart of a Java Virtual Machine process but rather just to change runtime state accordingly. 
541
542
In z2 a synchronization describes the following process:
543
544
# Check for changes in component repositories
545
# Based on changes found, identify components affected and invalidate associated runtime resources incl. dependent resources.
546
# Try to attain target states
547
548 1 Henning Blohm
That is, whenever you do a change and trigger a synchronization from your IDE, this is exactly what happens: Identify what needs to be thrown away, make sure to remove dependent stuff as well,  bring up what needs to be running.
549 16 Henning Blohm
550
h3. A second crucial concept of z2 is that of *System Centric Development*
551
552
When working on a software system with many access points and high re-use on a service level, as is typical for business systems, staying quick integration with a team's changes is key. Component repositories can be fed from remotely accessible version control systems such as Subversion and Git. When connecting to a central, team-shared repository, every synchronization will make sure that you are up-to-date with the real source of truth. 
553
554
Using the dev repo, you can still isolate yourself from changes on part of the system that you are actively working on. After your modifications are completed, rebased, and locally tested, getting a clean and consistent state is just one synchronization away.
555
556
h3. The third and final concept is that of a compile-free environment
557
558
It is within the nature of the synchronization concept, that anything required to happen to have your software available for execution must have happened after synchronization completed. Most preparation steps are executed at first use. This includes the compilation of Java code. Z2 uses the Eclipse Java Compiler for that purpose.
559 9 Henning Blohm
560
h2. The Component Model
561
562
See [[z2-environment:Z2_Modules_intro]]
563
564
h2. Java Components
565
566
See [[z2-environment:Z2_Java_components_intro]]