Modified: zest/site/content/java/develop/what-is-cop.html
URL: 
http://svn.apache.org/viewvc/zest/site/content/java/develop/what-is-cop.html?rev=1689843&r1=1689842&r2=1689843&view=diff
==============================================================================
--- zest/site/content/java/develop/what-is-cop.html (original)
+++ zest/site/content/java/develop/what-is-cop.html Wed Jul  8 11:08:41 2015
@@ -66,20 +66,20 @@
   })();
  </script>
 
-  </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="logo"><a href="index.html"><img src="images/logo-standard.png" 
/></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml"; 
class="toc"><dl><dt><span class="section"><a 
href="index.html#home">Qi4j</a></span></dt><dt><span class="section"><span 
xmlns="" href="intro.html">Introduction</span></span></dt><dt><span 
class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span 
class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span 
class="section"><a href="samples.html">Samples</a></span></dt><dt><span 
class="section"><a href="core.html">Core</a></span></dt><dt><span 
class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span 
class="section"><a href="extensions.html">Extensions</a></span></dt><dt><span 
class="section"><a href="tools.html">Tools</a></span></dt><dt><span 
class="section"><a href="glossary.html">Glo
 ssary </a></span></dt></dl></div></div><div xmlns="" 
xmlns:exsl="http://exslt.org/common"; class="sub-nav"><div 
xmlns="http://www.w3.org/1999/xhtml"; class="toc"><dl><dt><span 
class="section"><a 
href="intro.html#highlights">Highligts</a></span></dt><dt><span 
class="section"><a 
href="introduction-background.html">Background</a></span></dt><dt><span 
class="section"><span xmlns="" href="what-is-cop.html">What is 
COP?</span></span></dt><dt><span class="section"><a 
href="what-s-an-object-anyway.html">What’s an Object 
anyway?</a></span></dt><dt><span class="section"><a 
href="state-modeling.html">Qi4j and state modeling</a></span></dt><dt><span 
class="section"><a href="related.html">Related publications &amp; 
projects</a></span></dt></dl></div></div><div class="section" title="What is 
COP?"><div class="titlepage"><div><div><h3 class="title"><a 
id="what-is-cop"></a>What is COP?</h3></div></div></div><p>We found this very 
well written blog entry on the Internet, which very well describ
 es what Composite Oriented
+  </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="logo"><a href="index.html"><img src="images/logo-standard.png" 
/></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml"; 
class="toc"><dl><dt><span class="section"><a 
href="index.html#home">Zest™</a></span></dt><dt><span class="section"><span 
xmlns="" href="intro.html">Introduction</span></span></dt><dt><span 
class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span 
class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span 
class="section"><a href="samples.html">Samples</a></span></dt><dt><span 
class="section"><a href="core.html">Core</a></span></dt><dt><span 
class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span 
class="section"><a href="extensions.html">Extensions</a></span></dt><dt><span 
class="section"><a href="tools.html">Tools</a></span></dt><dt><span 
class="section"><a href="glossary.htm
 l">Glossary </a></span></dt></dl></div></div><div xmlns="" 
xmlns:exsl="http://exslt.org/common"; class="sub-nav"><div 
xmlns="http://www.w3.org/1999/xhtml"; class="toc"><dl><dt><span 
class="section"><a 
href="intro.html#highlights">Highligts</a></span></dt><dt><span 
class="section"><a 
href="introduction-background.html">Background</a></span></dt><dt><span 
class="section"><span xmlns="" href="what-is-cop.html">What is 
COP?</span></span></dt><dt><span class="section"><a 
href="what-s-an-object-anyway.html">What’s an Object 
anyway?</a></span></dt><dt><span class="section"><a 
href="state-modeling.html">Zest™ and state modeling</a></span></dt><dt><span 
class="section"><a href="related.html">Related publications &amp; 
projects</a></span></dt></dl></div></div><div class="section" title="What is 
COP?"><div class="titlepage"><div><div><h3 class="title"><a 
id="what-is-cop"></a>What is COP?</h3></div></div></div><p>We found this very 
well written blog entry on the Internet, which very 
 well describes what Composite Oriented
 Programming really is.</p><p>The article uses C# and a "show by example" 
approach to explaining COP, and this shows clearly that COP is not
-Java specific, and although Qi4j was (to our knowledge) first to introduce the 
name, it applies across languages and
+Java specific, and although Zest™ was (to our knowledge) first to introduce 
the name, it applies across languages and
 potentially deserves one or more languages on its own.</p><p>The article is 
re-published here, as allowed by the
 <a class="ulink" 
href="http://msdn.microsoft.com/en-us/windowsmobile/bb264332.aspx"; 
target="_top">Microsoft Permissive License</a>
 , more recently known as
 <a class="ulink" href="http://www.opensource.org/licenses/MS-PL"; 
target="_top">Microsoft Public License</a>. The content below
 is NOT under the usual <a class="ulink" 
href="http://www.opensource.org/licenses/Apache-2.0"; target="_top">Apache 
License</a>.</p><p>We would like to thank Fredrik Kalseth for his explicit 
approval as well.</p><div class="section" title="Composite Oriented 
Programming"><div class="titlepage"><div><div><h4 class="title"><a 
id="_ulink_url_http_iridescence_no_post_composite_oriented_programming_aspx_composite_oriented_programming_ulink"></a><a
 class="ulink" 
href="http://iridescence.no/post/composite-oriented-programming.aspx"; 
target="_top">Composite Oriented 
Programming</a></h4></div></div></div><p>I’ve written a series of post on AOP 
lately (here, here and here), and in the last part I promised to tackle mixins
 and introductions in a future post. When I was doing my research for just 
that, I came cross a Java framework (just
-humor me :p) called Qi4j (that’s <span class="emphasis"><em>chee for 
jay</em></span>), written by Swedish Richard Öberg, pioneering the idea of 
Composite
+humor me :p) called Zest™ (that’s <span class="emphasis"><em>chee for 
jay</em></span>), written by Swedish Richard Öberg, pioneering the idea of 
Composite
 Oriented Programming, which instantly put a spell on me. Essentially, it takes 
the concepts from Aspect Oriented
 Programming to the extreme, and for the past week I’ve dug into it with a 
passion. This post is the first fruits of
 my labor.</p><div class="section" title="OOP is Not Object Oriented!"><div 
class="titlepage"><div><div><h5 class="title"><a 
id="_oop_is_not_object_oriented"></a>OOP is Not Object 
Oriented!</h5></div></div></div><p>One of the things that Richard Öberg 
argues, is that OOP is not really object oriented at all, but rather class
-oriented. As the Qi4j website proclaims, "class is the first class citizen 
that objects are derived from. Not objects
+oriented. As the Zest™ website proclaims, "class is the first class citizen 
that objects are derived from. Not objects
 being the first-class citizen to which one or many classes are assigned". 
Composite oriented programming (COP) then,
 tries to work around this limitation by building on a set of core principles; 
that behavior depends on context, that
 decoupling is a virtue, and that business rules matter more. For a short and 
abstract explanation of COP,
@@ -257,7 +257,7 @@ public interface ISubtraction : ICalcula
 posts. I’ve already implemented a prototype framework that supports the 
above examples, which builds on my
 <a class="ulink" 
href="http://www.iridescence.no/Posts/Implementing-an-AOP-Framework-Part-2.aspx";
 target="_top">previously posted AOP framework</a>, and I’ll
 post the source code for that soon. If you want to dig deeper right now (and 
don’t mind
-a bit of Java), then I suggest you head over to the Qi4j website and poke 
about there.
+a bit of Java), then I suggest you head over to the Zest™ website and poke 
about there.
 <a class="ulink" href="http://rickardoberg.wordpress.com/"; 
target="_top">Richard Öbergs blog</a> also provides great 
insight.</p></div></div></div><div xmlns="" 
xmlns:exsl="http://exslt.org/common"; class="footer"><p>
         Copyright © 2015 The Apache Software Foundation, Licensed under the 
<a href="http://www.apache.org/licenses/"; target="_blank">Apache License, 
Version 2.0</a>.
         <br /><small>

Modified: zest/site/content/java/develop/what-s-an-object-anyway.html
URL: 
http://svn.apache.org/viewvc/zest/site/content/java/develop/what-s-an-object-anyway.html?rev=1689843&r1=1689842&r2=1689843&view=diff
==============================================================================
--- zest/site/content/java/develop/what-s-an-object-anyway.html (original)
+++ zest/site/content/java/develop/what-s-an-object-anyway.html Wed Jul  8 
11:08:41 2015
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";><html 
xmlns="http://www.w3.org/1999/xhtml";><head><meta http-equiv="Content-Type" 
content="text/html; charset=UTF-8" /><title>What’s an Object 
anyway?</title><link rel="stylesheet" type="text/css" href="css/style.css" 
/><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link 
rel="home" href="index.html" title="" /><link rel="up" href="intro.html" 
title="Introduction" /><link rel="prev" href="what-is-cop.html" title="What is 
COP?" /><link rel="next" href="state-modeling.html" title="Qi4j and state 
modeling" />
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";><html 
xmlns="http://www.w3.org/1999/xhtml";><head><meta http-equiv="Content-Type" 
content="text/html; charset=UTF-8" /><title>What’s an Object 
anyway?</title><link rel="stylesheet" type="text/css" href="css/style.css" 
/><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link 
rel="home" href="index.html" title="" /><link rel="up" href="intro.html" 
title="Introduction" /><link rel="prev" href="what-is-cop.html" title="What is 
COP?" /><link rel="next" href="state-modeling.html" title="Zest™ and state 
modeling" />
 
 
 <!-- favicon -->
@@ -66,7 +66,7 @@
   })();
  </script>
 
-  </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="logo"><a href="index.html"><img src="images/logo-standard.png" 
/></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml"; 
class="toc"><dl><dt><span class="section"><a 
href="index.html#home">Qi4j</a></span></dt><dt><span class="section"><span 
xmlns="" href="intro.html">Introduction</span></span></dt><dt><span 
class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span 
class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span 
class="section"><a href="samples.html">Samples</a></span></dt><dt><span 
class="section"><a href="core.html">Core</a></span></dt><dt><span 
class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span 
class="section"><a href="extensions.html">Extensions</a></span></dt><dt><span 
class="section"><a href="tools.html">Tools</a></span></dt><dt><span 
class="section"><a href="glossary.html">Glo
 ssary </a></span></dt></dl></div></div><div xmlns="" 
xmlns:exsl="http://exslt.org/common"; class="sub-nav"><div 
xmlns="http://www.w3.org/1999/xhtml"; class="toc"><dl><dt><span 
class="section"><a 
href="intro.html#highlights">Highligts</a></span></dt><dt><span 
class="section"><a 
href="introduction-background.html">Background</a></span></dt><dt><span 
class="section"><a href="what-is-cop.html">What is 
COP?</a></span></dt><dt><span class="section"><span xmlns="" 
href="what-s-an-object-anyway.html">What’s an Object 
anyway?</span></span></dt><dt><span class="section"><a 
href="state-modeling.html">Qi4j and state modeling</a></span></dt><dt><span 
class="section"><a href="related.html">Related publications &amp; 
projects</a></span></dt></dl></div></div><div class="section" title="What’s 
an Object anyway?"><div class="titlepage"><div><div><h3 class="title"><a 
id="what-s-an-object-anyway"></a>What’s an Object 
anyway?</h3></div></div></div><p>In OOP the main idea is that we shoul
 d model our reality by creating Objects. Objects have state, and they have 
methods.
+  </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="logo"><a href="index.html"><img src="images/logo-standard.png" 
/></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml"; 
class="toc"><dl><dt><span class="section"><a 
href="index.html#home">Zest™</a></span></dt><dt><span class="section"><span 
xmlns="" href="intro.html">Introduction</span></span></dt><dt><span 
class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span 
class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span 
class="section"><a href="samples.html">Samples</a></span></dt><dt><span 
class="section"><a href="core.html">Core</a></span></dt><dt><span 
class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span 
class="section"><a href="extensions.html">Extensions</a></span></dt><dt><span 
class="section"><a href="tools.html">Tools</a></span></dt><dt><span 
class="section"><a href="glossary.htm
 l">Glossary </a></span></dt></dl></div></div><div xmlns="" 
xmlns:exsl="http://exslt.org/common"; class="sub-nav"><div 
xmlns="http://www.w3.org/1999/xhtml"; class="toc"><dl><dt><span 
class="section"><a 
href="intro.html#highlights">Highligts</a></span></dt><dt><span 
class="section"><a 
href="introduction-background.html">Background</a></span></dt><dt><span 
class="section"><a href="what-is-cop.html">What is 
COP?</a></span></dt><dt><span class="section"><span xmlns="" 
href="what-s-an-object-anyway.html">What’s an Object 
anyway?</span></span></dt><dt><span class="section"><a 
href="state-modeling.html">Zest™ and state modeling</a></span></dt><dt><span 
class="section"><a href="related.html">Related publications &amp; 
projects</a></span></dt></dl></div></div><div class="section" title="What’s 
an Object anyway?"><div class="titlepage"><div><div><h3 class="title"><a 
id="what-s-an-object-anyway"></a>What’s an Object 
anyway?</h3></div></div></div><p>In OOP the main idea is t
 hat we should model our reality by creating Objects. Objects have state, and 
they have methods.
 Methods in an object are used to operate on the internal state and understands 
the domain that is being modeled.</p><p>By contrast, in procedural programming 
the focus is on algorithms, which can use several data structures to perform 
some
 task. The focus is on what is going on, rather than the "objects" 
involved.</p><p>With OOP it becomes more difficult to "read" algorithms, as 
they are spread out in many objects that interact. With
 procedural programming it becomes difficult to encapsulate and reuse 
functionality. Both represent extremes, neither of
@@ -84,7 +84,7 @@ there will be an interface, and for each
 This mixin can be specific for that composite implementation, or it can be 
generic and reused. The key point is that it
 is the OBSERVER of the object, meaning, the algorithm, that gets to decide 
what the object should be able to do.</p><p>This is the same in real life. I 
don’t get to decide how I communicate with you. I have to use english, and I 
have to
 use email, and I have to send it to a specific mailing list. It is the 
algorithm of the interaction between us, the
-Qi4j dev mailing list, that has set these rules, not <span 
class="strong"><strong>I</strong></span> as a participant in this interaction. 
The same should,
+Zest™ dev mailing list, that has set these rules, not <span 
class="strong"><strong>I</strong></span> as a participant in this interaction. 
The same should,
 obviously, be the case for objects.</p><p>So, with the understanding that 
algorithms should define roles for collaborating objects, and objects should 
then
 implement these in order to participate in these algorithms, it should be 
trivial to realize that what has passed for
 OOP so far, in terms of "class oriented programming", where this role-focus of 
objects is difficult to achieve, if not
@@ -92,7 +92,7 @@ even impossible, is just plain wrong. I
 designated as "coordinator", which then delegates to a number of other objects 
in order to implement the various roles.
 This "solution", which is caused by this fundamental flaw in "class oriented 
programming", is essentially a hack, and
 causes a number of other problems, such as the "self schizophrenia" problem, 
whereby there is no way to tell where the
-object really is. There is no "this" pointer that has any relevant 
meaning.</p><p>The Composite pattern, as implemented in COP and Qi4j, gets 
around this by simply saying that the composite, as a
+object really is. There is no "this" pointer that has any relevant 
meaning.</p><p>The Composite pattern, as implemented in COP and Zest™, gets 
around this by simply saying that the composite, as a
 whole, is an object. Tada, we now have a "this" pointer, and a coherent way to 
deal with the object graph as though it
 was a single object. We are now able to get back to the strengths of the 
procedural approach, which allows the
 implementer of the algorithm to define the roles needed for the algorithm. The 
roles can either be specific to an
@@ -100,7 +100,7 @@ algorithm, or they can be shared between
 algorithm is not too tightly encoded in the composites, thereby making the 
algorithms more reusable, and making it less
 necessary to read composite code when trying to understand algorithms. The 
assumption here is that we are going to write
 more algorithms than composites, therefore it has to be easy to ready 
algorithms, and only when necessary dive down into
-composite code.</p><p>When talking about Composites as Objects in Qi4j it is 
most relevant to look at Entities, since these represent physical
+composite code.</p><p>When talking about Composites as Objects in Zest™ it 
is most relevant to look at Entities, since these represent physical
 objects in a model, rather than algorithms or services, or other 
non-instance-oriented things.</p><p>If Entities should implement roles, via 
mixins, in order to interact with each other through algorithms, then the
 majority of their behaviour should be put into those role-mixins. These are 
exposed publically for clients to use.
 However, the state that is required to implement these roles should not be 
exposed publically, as they represent
@@ -132,7 +132,7 @@ general allow our role-oriented approach
 generally reusable, and the state interfaces are usually reusable. This 
minimizes the need for us to go into the mixin
 code and read it. If we have read the mixin code once, and the same mixin is 
reused between objects, then this makes
 it easier for us to understand it the next time we see it being used in 
another algorithm.</p><p>To summarize thus far, we have looked at why OOP so 
far has not worked out, why this is the case, and how COP deals
-with it, and how we can implement a better solution of Entities using Qi4j. 
All is well!</p><p>The next step is to start using these Entities in 
algorithms. Algorithms are usually stateless, or at least they don’t
+with it, and how we can implement a better solution of Entities using Zest™. 
All is well!</p><p>The next step is to start using these Entities in 
algorithms. Algorithms are usually stateless, or at least they don’t
 have any state that survives the execution of the algorithm. There is input, 
some calculation, and then output. In
 other words, our notion of services fit perfectly here!</p><p>Algorithms, 
then, should(/could?) be modeled using services. If an algorithm needs other 
algorithms to compute
 something, that is, if a service needs another service to do something, we can 
accomplish this using dependency
@@ -162,14 +162,14 @@ would need to get the three objects invo
 selected item in a list, and "TaskExecutor to" could be a user designated from 
a popup dialog. These three are then
 taken by the context and used to execute the "delegate" interaction, which 
performs all the steps necessary.</p><p>The interaction method "delegate" is 
testable, both with mocks of the input, and with specific instances of the 
various
 roles. The implementations are also testable, and if the same mixin is used 
over and over for the implementation, then
-only one set of tests is needed for each role interface.</p><p>To summarize we 
have in COP/Qi4j a way to get the best from procedural and object-oriented 
programming. As we have seen
+only one set of tests is needed for each role interface.</p><p>To summarize we 
have in COP/Zest™ a way to get the best from procedural and object-oriented 
programming. As we have seen
 the functionality falls into three categories, the entities implementing 
objects, the services implementing
 interactions, and the user interface implementing the context. This also maps 
well to the ideas of ModelViewController,
 which in turn maps well to the new ideas from Mr Reenskaug (inventor of MVC) 
called DCI: Data-Context-Interaction. As a
-side-effect of this discussion we have therefore also seen how COP/Qi4j can be 
used to implement DCI, which is an
+side-effect of this discussion we have therefore also seen how COP/Zest™ can 
be used to implement DCI, which is an
 important next step in understanding objects and their interactions, the 
fundamentals of which (I believe) are captured
 on this page.</p><p>That’s it. Well done if you’ve read this far 
:-)</p><p>Comments and thoughts to qi4j-dev forum at Google Groups on this are 
highly appreciated. This is very very important topics,
-and crucial to understanding/explaining why COP/Qi4j is so great! 
:-)</p></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="footer"><p>
+and crucial to understanding/explaining why COP/Zest™ is so great! 
:-)</p></div><div xmlns="" xmlns:exsl="http://exslt.org/common"; 
class="footer"><p>
         Copyright © 2015 The Apache Software Foundation, Licensed under the 
<a href="http://www.apache.org/licenses/"; target="_blank">Apache License, 
Version 2.0</a>.
         <br /><small>
             Apache Zest, Zest, Apache, the Apache feather logo, and the Apache 
Zest project logo are trademarks of The Apache Software Foundation.<br />


Reply via email to