Project

General

Profile

Getting Started » History » Version 5

Henning Blohm, 01.03.2015 21:17

1 3 Henning Blohm
h1. Getting Started with org.z2env
2 1 Henning Blohm
3
See also [[FAQ]]
4
5
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. 
6
7
Check out [[wiki#Understanding-Z2|understanding-z2]] for that.
8
9
It is simplest to start by running a simple Java main program in z2 or a simple Web App. 
10
11
Follow this trail:
12
13
* [[Getting Started#Building-z2env-core|Building the core]]
14
* [[Getting Started#Running-a-Hello-World-main-program|Running a Hello World main program]]
15
* [[Getting Started#Running-a-Hello-World-Web-App|Running a Hello World Web App]]
16
* [[Getting Started#Developing-with-Eclipse-or-IntelliJ|Developing with Eclipse or IntelliJ]]
17
* [[Getting Started#Going-Multi-Module|Going Multi Module]]
18
19
20
h2. Building z2env-core
21
22
(For now, we need to build the core).
23
24 4 Henning Blohm
{{collapse
25 1 Henning Blohm
h3. Pre-requisites
26
27
* You need Git installed
28
* You need a JDK, at least version 7
29
* You need the ANT build tool
30
31
First clone http://git.z2-environment.net/z2env.core
32
33
<pre>
34
git clone http://git.z2-environment.net/z2env.core
35
</pre>
36
37
Change into *org.z2env.core.main* and run 
38
39
<pre>
40
ant -Doutput=<z2home> -Dsetup=<setup> 
41
</pre>
42
43
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.
44
45
If you omit *output* it will default to *gen/dist*. If you omit *setup*, no content will be pre-configured will be modified. 
46
47
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).
48
49
In general this build always updates only boot, z.jar, roots. It will not remove anything.
50
51
52
Example to install/update a core only into ../../z2env:
53
54
<pre>
55
ant -Doutput=../../z2env 
56
</pre>
57
58
To install/update a web-basic setup (with tomcat and eclipsoid support) with updates from remote repos:
59
60
<pre>
61
ant -Doutput=../../z2env -Dsetup=web-basic-remote
62
</pre>
63
64
Check out [[wiki#Understanding-the-ltHOMEgt|Understanding the <HOME>]] to learn more about the generated structure.
65
66 2 Henning Blohm
h4. Summary
67 1 Henning Blohm
68 2 Henning Blohm
* At any time you can update a z2 core installation by running the core build and using the *output* property to point to your installation
69
* Using the *setup* property you can choose between completely local setups (no remote access required - no automatic synchronization from remote either) or mostly remote setups (all except the core will be synchronized from remote repositories). 
70
71 4 Henning Blohm
}}
72
73 1 Henning Blohm
h2. Running a Hello World main program
74
75 5 Henning Blohm
In this section we will let z2 do what it is actually made for: Run some Java program in a modular environment without build and deploy.
76
77 4 Henning Blohm
{{collapse
78 1 Henning Blohm
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. 
79
80
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 
81
82
<pre>
83
greeter/hello
84
</pre>
85
86
Finally, as this component actually has implementation code, we need to declare a Java component. By convention this is 
87
88
<pre>
89
greeter/java
90
</pre>
91
92
Now, after installing in <HOME> the place to simply drop a module is under <HOME>/modules. You might need to create that folder.
93
94
All in all, here is the complete structure to create:
95
96
| <HOME>/modules/greeter/hello.properties | 
97
<pre><code class="ruby">org.z2env.component.type=org.z2env.main
98
component.className=greetings.Main
99
</code></pre> |
100
| <HOME>/modules/greeter/java/z.properties | 
101
<pre><code class="ruby">org.z2env.component.type=org.z2env.java
102
</code></pre> |
103
| <HOME>/modules/greeter/java/src.impl/greetings/Main.java |
104
<pre><code class="java">
105
package greetings;
106
107
public class Main {
108
  public static void main(String[] args) {
109
    System.out.println("Hello!");
110
  }
111
}
112
</code></pre> |
113
114
That gives us the two components of module greeter. To run this on the command line, run
115
116
<pre>
117
java -DcomponentName=greeter/hello -jar z.jar
118
</pre>
119
120
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.
121
122 2 Henning Blohm
h4. Summary
123
124
* Running a simple program in a modular environment requires no more than declaring the modules and add some code
125
* Apart from more technical component types, at the heart of the z2 core is to run simple Java main programs
126
127 4 Henning Blohm
}}
128 2 Henning Blohm
129 1 Henning Blohm
h2. Running a Hello World Web App
130
131 4 Henning Blohm
{{collapse
132
133 1 Henning Blohm
This introduction explains how to connect a z2 core to a given Tomcat installation and how to develop a simple Web Application.
134
135
Furthermore it describes how to use the Dev Repository and the Eclipsoid plugin for the Eclipse or the IntelliJ development environment.
136
137
h3. Pre-Requisites
138
139
* We assume a development workspace in *workspace*.
140
* Have a local Tomcat (7 or higher) installation.*
141
142
h3. Steps we are going to take
143
144
# Create a module with a simple Web app
145
# Make it visible to Z2
146
# Run the Web App in a Tomcat Web Container
147
148
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 
149
150
<pre>
151
ant -Doutput=workspace/z2env -Dsetup=web-basic-remote
152
</pre>
153
154
(*Note:* If in doubt, use an absolute path for *workspace*)
155
156
Using your IDE create a new project *hello* in *workspace* with the following structure:
157
158
| java/z.properties | 
159
<pre><code class="ruby">
160
org.z2env.component.type=org.z2env.java
161
java.privateReferences=\
162
	javax.servlet
163
</code></pre> |
164
| web/z.properties |
165
<pre><code class="ruby">
166
org.z2env.component.type=org.z2env.tomcat.webapp
167
webapp.path=/hello
168
</code></pre> |
169
| web/WebContent/index.jsp |
170
<pre><code class="html"><html><body>Hello! Did you know that 7*7=<%=7*7%>?</body></html></code></pre> |
171
| LOCAL | <empty file> |
172
173
Your *workspace* folder now contains two subfolders *z2env* and *hello*.
174
175
So far, that's it.  We will touch on the LOCAL file later. 
176
177
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. 
178
179
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*. 
180
181
To be on the safe side and assuming the location is */home/me/tomcat*, we open a terminal, change into *workspace/z2env* and run
182
183
<pre>
184
java -Dcatalina.home=/home/me/tomcat -jar z.jar hello/web
185
</pre>
186
187
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 
188
189
<pre>
190
http://localhost:8080/hello
191
</pre>
192
193
*Note:* What you just created is a prototypical z2 module structure containing a Java component *java* (holding implementation) and a Web component *web*. 
194
195
Instead of creating the structure yourself, you could use the Eclipsoid plugin (introduced below) for that:
196
* In Eclipse: New / Others / new z2...., 
197
* In IntelliJ: New / Module / z2....
198
199
... but beware of the pre-generated configuration. Where it says *com.zfabrik* change to *org.z2env*.
200
201
202
*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. 
203
204
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.
205
206
We call modules with a LOCAL file _armed_.
207
208
*Note:* By default the dev repo looks for modules beneath the parent folder of the <home> location. Use the system property *org.z2env.dev.local.workspace* to specify other locations (separated by comma) to check for modules.
209
210
211
Try this: 
212
213
# Remove LOCAL
214
# Enter „s“ for synchronization. 
215
# Check the URL above (should say „not found“)
216
# Create a LOCAL file again
217
# Synchronize
218
# Check again.
219
220
Similarly, from now on, changes made to the hello module will be picked up, whenever you synchronize.
221
222 2 Henning Blohm
h4. Summary
223
224
* Addons extend z2 with capabilities, such as a Tomcat hosted Web application (albeit running in z2's module environment)
225
* The _dev repository_ allows to flexibly define local modules. Modules can put into or out visibility by a simple LOCAL marker file.
226
227 4 Henning Blohm
}}
228
229 1 Henning Blohm
h2. Developing with Eclipse or IntelliJ
230
231
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.
232
233 4 Henning Blohm
{{collapse
234
235 1 Henning Blohm
h3. Pre-Requisite
236
237
* Have an Eclipse or IntelliJ installation
238
* Install the Eclipsoid plugin from http://z2-environment.net/eclipsoid/update/site.xml or by searching for "z2" in the IntelliJ Plugin Repository respectively
239
240
h3. Steps we are going to take
241
242
# Complete the development workspace setup
243
# Add a simple Controller
244
245
h4. In Eclipse
246
247
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. 
248
249
Add a source folder *java/src.impl* to the project.
250
251
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. 
252
253
Go into Window/Preferences, pick "z2-Environment". Change the port to 8081, set the user to "z*" and the password to "z". Done.
254
255
h4. In IntelliJ
256
257
Add a source folder *java/src.impl* to the module.
258
259
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.
260
261
h4. Independently of whether you use IntelliJ or Eclipse
262
263
Start z2 as in the previous section but make sure the development support is enabled. Use this command line:
264
265
<pre>
266
java -Dcatalina.home=/home/me/tomcat -jar z.jar org.z2env.dev.shared/ready hello/web
267
</pre>
268
269
(possibly you want to turn this into a shell script)
270
271
*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.
272
273
274
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. 
275
276
Now add a class *SimpleController* and change the following files:
277
278
| java/src.impl/hello/SimpleController.java | 
279
<pre><code class="java">
280
package hello;
281
282
import javax.servlet.*;
283
import javax.servlet.http.*;
284
import java.io.IOException;
285
286
public class SimpleController extends HttpServlet {
287
288
    @Override
289
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
290
        String input = req.getParameter("input");
291
        if (input!=null && input.trim().length()>0) {
292
            req.setAttribute("output","You said: "+input);
293
        }
294
        req.getRequestDispatcher("/").forward(req,resp);
295
    }
296
}
297
</code></pre> |
298
| java/z.properties | 
299
<pre><code class="ruby">
300
org.z2env.component.type = org.z2env.java
301
302
java.privateReferences=\
303
  javax.servlet,\
304
  javax.servlet.jsp.jstl
305
</code></pre> |
306
| web/WebContent/WEB-INF/web.xml | 
307
<pre><code class="xml">
308
<?xml version="1.0" encoding="UTF-8"?>
309
<web-app id="hello" version="2.5"
310
		xmlns="http://java.sun.com/xml/ns/javaee"
311
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
312
		xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
313
314
    <servlet>
315
        <servlet-name>controller</servlet-name>
316
        <servlet-class>hello.SimpleController</servlet-class>
317
    </servlet>
318
    
319
    <servlet-mapping>
320
        <servlet-name>controller</servlet-name>
321
        <url-pattern>/do</url-pattern>
322
    </servlet-mapping>    
323
</web-app>
324
</code></pre> |
325
| web/WebContent/index.jsp |
326
<pre><code class="html">
327
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core_1_1" %>
328
<html>
329
<body>
330
  <c:if test="${not empty output}">
331
    <p><c:out value="${output}"/></p>
332
  </c:if>
333
  <form method="POST" action="<c:url value='/do'/>">
334
    Input: <input type="text" name="input"><input type="submit" value="go!">
335
  </form>
336
</body>
337
</html>
338
</code></pre>|
339
340
Make sure the *hello* module is armed (right-click) by having a LOCAL file.
341
342
Now synchronize your running z2 by either:
343
344
* Pressing the "Sync with z2-Environment" button in the toolbar
345
* Pressing ALT+y in your IDE
346
* Entering "s" on the command line running z2.
347
348
Go to http://localhost:8080/hello and check it out.
349
350 2 Henning Blohm
h4. Summary
351 1 Henning Blohm
352 2 Henning Blohm
* Using IDE plugins for Eclipse or IntelliJ you can conveniently develop for Z2.
353
* Regardless of the component types in use, all class path considerations will be resolved from Z2 and you will never need to change IDE configuration.
354
* Using the interplay of IDE plugin and the dev repository (see also [[FAQ#Development]]) synchronization from the IDE and overlay of modules with local development versions is simple and fast. 
355
356 4 Henning Blohm
}}
357
358 1 Henning Blohm
h2. Going Multi-Module
359
360
In this section we will extend the previous work by a simple service module. 
361
362 4 Henning Blohm
{{collapse
363 1 Henning Blohm
h3. Pre-Requisites
364
365
# Have all the results from the previous section ready.
366
# Start IDE and z2 as above.
367
368
369
h3. Steps we are going to take
370
371
# add a new module with a service API
372
# reference the module API from the *hello* module and invoke the service.
373
374
375
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
376
377
<pre><code class="ruby">
378
org.z2env.component.type=org.z2env.java
379
</code></pre>
380
381
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. 
382
383
384
| java/src.api/goodbye/GoodbyeService.java | 
385
<pre><code class="java">
386
package goodbye;
387
388
public interface GoodbyeService {
389
390
	String sayGoodbye(String in);
391
	
392
}
393
394
</code></pre> |
395
| java/src.impl/goodbye/GoodbyeServiceImpl.java | 
396
<pre><code class="java">
397
package goodbye;
398
399
public class GoodbyeServiceImpl implements GoodbyeService {
400
401
	@Override
402
	public String sayGoodbye(String in) {
403
		return "Goodbye "+in+"!";
404
	}
405
406
}
407
</code></pre> |
408
| java/service.properties | 
409
<pre><code class="ruby">
410
org.z2env.component.type=org.z2env.any
411
component.className=goodbye.GoodbyeServiceImpl
412
</code></pre> |
413
| java/z.properties | 
414
<pre><code class="ruby">
415
org.z2env.component.type=org.z2env.java
416
</code></pre> |
417
418
In effect we created the following:
419
420
* A module *goodbye* that has 
421
* A Java component with API and Implementation source code
422
* An _any_ component *goodbye/service* that manages the service implementation (as we will see below)
423
424
Back in the *hello* module, we want to use the _goodbye service_. We apply the following changes:
425
426
| java/z.properties | 
427
<pre><code class="ruby">
428
org.z2env.component.type=org.z2env.java
429
430
java.privateReferences=\
431
    javax.servlet,\
432
    javax.servlet.jsp.jstl,\
433
    goodbye
434
</code></pre> |
435
| java/src.impl/hello/SimpleController.java | 
436
<pre><code class="java">
437
package hello;
438
439
import goodbye.GoodbyeService;
440
441
import java.io.IOException;
442
443
import javax.servlet.ServletException;
444
import javax.servlet.http.HttpServlet;
445
import javax.servlet.http.HttpServletRequest;
446
import javax.servlet.http.HttpServletResponse;
447
448
import org.z2env.components.IComponentsLookup;
449
450
public class SimpleController extends HttpServlet {
451
452
    @Override
453
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
454
    	GoodbyeService gb = IComponentsLookup.CL.lookup("goodbye/service", GoodbyeService.class);
455
        String input = req.getParameter("input");
456
        if (input!=null && input.trim().length()>0) {
457
            req.setAttribute(
458
        		"output",
459
        		gb.sayGoodbye(input)
460
        	);
461
        }
462
        req.getRequestDispatcher("/").forward(req,resp);
463
    }
464
}
465
</code></pre> |
466
467
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
468
your IDE will not complain about using the *GoodbyeService* interface.
469
470
Now synchronize your running z2 by either:
471
472
* Pressing the "Sync with z2-Environment" button in the toolbar
473
* Pressing ALT+y in your IDE
474
* Entering "s" on the command line running z2.
475
476
Go to http://localhost:8080/hello and check it out.
477
478
h3. Discussion
479
480
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.
481
482
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.
483
484 2 Henning Blohm
h4. Summary
485
486
* Being a modular runtime environment, Z2 offers an effective yet simple Java modularization approach
487
* The module concept of Z2 goes beyond code considerations and includes arbitrary component types such as Web applications
488
489 1 Henning Blohm
Feel free to apply changes to the Goodbye Service implementation class and have them made effective by synchronizing Z2.
490
491 4 Henning Blohm
}}
492
493
{{collapse
494
495 1 Henning Blohm
h2. Going System-Centric
496 2 Henning Blohm
497
In this section we show how to turn your z2 installation into a mere execution node of a system (which is what it really should be). That is, in team development situations for systems of non-trivial size of distribution requirements, it is crucial to be integrated with a common source code level. 
498 1 Henning Blohm
499 4 Henning Blohm
{{collapse
500
501 2 Henning Blohm
Using remote repositories in combination with the dev repository, z2 offers just that: Integration for all but those pieces you do actually need isolation from changes.
502
503
Using z2's synchronization approach rolling out changes to remote installation and scale-outs become a non-issue.
504
505
h3. Steps we are going to take
506
507
# check our modules in with some new Git repository
508
# add a Git-based component repository component 
509
# develop with partial overlays
510
511
512 1 Henning Blohm
513 4 Henning Blohm
}}
514 1 Henning Blohm
515
516
h2. Understanding the <HOME>
517
518 4 Henning Blohm
We call an installation of a z2env core a *<home>*. The file structure of the *<home>* consists of few but important locations.
519 1 Henning Blohm
520 4 Henning Blohm
{{collapse
521 1 Henning Blohm
h3. Layout
522
523
| z.jar | The actual core implementation. This is precompiled.|
524
| boot/ | A component repository adding to the core and provides the most basic capabilities such as compiling Java code and running a main program. |
525
| 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. |
526
| modules/ | A file system repository declared under roots/ that is useful to locally augment a core installation.|
527
528
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.
529
530 4 Henning Blohm
531
532
533 1 Henning Blohm
h3. Folders and Properties
534
535
When running z2 from the command line, some logic is applied to derive where stuff is and some defaults apply:
536
537
|_. What |_. System property |_. Defaults |
538
| 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 |
539
| 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 |
540
541 4 Henning Blohm
See also [[Core Layout]]
542 1 Henning Blohm
543 4 Henning Blohm
}}
544
545 1 Henning Blohm
h2. Understanding Z2
546
547
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.
548
549 4 Henning Blohm
{{collapse
550 1 Henning Blohm
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.
551
552
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. 
553
554
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.
555
556
*Component Repositories* provides modules and components to z2. A component is prefixed by the module name:
557
558
<pre>
559
<global component name> = <module name>/<local component name>
560
</pre>
561
562
In fact, the typical component repository has a file system style structure that is made up exactly like that. 
563
564
Structure from repo root:
565
566
| /<module>/<cmp>.properties | A component <cmp> in module <module> that has no resources on its own.|
567
| /<module>/<cmp>/z.properties | A component <cmp> in module <module> that may have additional resources on its own.|
568
569
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.
570
571
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.
572
573
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). 
574
575
!uml1.png!
576
577
Dependencies, for example those between Java components, translate into dependencies between resources that are observed during invalidation of resources. This introduces invalidation and synchronization.
578
579
h3. A crucial concept of z2 is that of a synchronization. 
580
581
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. 
582
583
In z2 a synchronization describes the following process:
584
585
# Check for changes in component repositories
586
# Based on changes found, identify components affected and invalidate associated runtime resources incl. dependent resources.
587
# Try to attain target states
588
589
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.
590
591
h3. A second crucial concept of z2 is that of *System Centric Development*
592
593
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. 
594
595
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.
596
597
h3. The third and final concept is that of a compile-free environment
598
599
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.
600
601
h2. The Component Model
602
603
See [[z2-environment:Z2_Modules_intro]]
604
605
h2. Java Components
606
607
See [[z2-environment:Z2_Java_components_intro]]
608 4 Henning Blohm
609
}}