You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by an...@apache.org on 2018/12/23 15:22:01 UTC

[royale-docs] branch master updated: Small text edits

This is an automated email from the ASF dual-hosted git repository.

andreww pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 8730df6  Small text edits
8730df6 is described below

commit 8730df695588e3c1b064e90fcb9dd9e49002346c
Author: Andrew Wetmore <an...@cottage14.com>
AuthorDate: Sun Dec 23 11:21:57 2018 -0400

    Small text edits
---
 .../migrate-an-existing-app/circular-dependencies.md       | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/create-an-application/migrate-an-existing-app/circular-dependencies.md b/create-an-application/migrate-an-existing-app/circular-dependencies.md
index 1e83edc..e0b9703 100644
--- a/create-an-application/migrate-an-existing-app/circular-dependencies.md
+++ b/create-an-application/migrate-an-existing-app/circular-dependencies.md
@@ -41,18 +41,20 @@ public class Parent {
   public var child:Child;
 }
 ```
-In Flash and AIR the runtime constructs both classes before type-checking for parent and child properties. That happens only when the application code has initialized and starts to run.
+In Flash and AIR the runtime constructs both classes before type-checking for parent and child properties. Type-checking happens only when the application code has initialized and starts to run.
 
 ## What compiling for JavaScript in Royale requires
 
 Royale uses the <a href="https://developers.google.com/closure/compiler/" target="_blank">Google Closure Compiler</a> (GCC) to compile your application into JavaScript that can run on browsers and mobile phones without heavy plugins like Flash. GCC "parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls." 
 
 
-GCC is does not like circular dependencies that Flash allows.  The reason is that, in development mode, each class is loaded by a separate Script element so there has to be a well-defined order to load these scripts.  GCC also wants each class to declare the classes it uses via an API called goog.require.  So in the Flash example above, Child will have goog.require('Parent') and Parent will have goog.require('Child') and GCC doesn't know which file to load first and it doesn't really wan [...]
+GCC does not like circular dependencies that Flash allows. The reason is that, in development mode, each class is loaded by a separate script element, so there has to be a well-defined order to load these scripts. GCC also wants each class to declare the classes it uses via an API called goog.require. So in the Flash example above, Child will have goog.require('Parent') and Parent will have goog.require('Child') and GCC doesn't know which file to load first and it doesn't really want to  [...]
 
-Fortunately, the Royale compiler has an option called -remove-circulars that is on by default.  It will analyze the code and determine which goog.require to remove such that GCC won't complain about the circularities and load the scripts in the right order.  However, if you want to know how to refactor your code so that you don't create what GCC considers to be circular dependencies, read on.
+Fortunately, the Royale compiler has an option called -remove-circulars that is on by default. It analyzes the code and determines which goog.require to remove so GCC won't complain about the circularities and can load the scripts in the right order. However, if you want to know how to refactor your code so that you don't create what GCC considers to be circular dependencies, read on.
 
-GCC recommends refactoring these two classes to use interfaces.  Some folks believe that classes should never reference other classes, only interfaces.  There are some advantages to this approach, but it is more work.  So, you would define two interfaces like this:
+GCC recommends refactoring interdependent classes to use interfaces. Some folks believe that classes should never reference other classes, only interfaces. There are some advantages to this approach, but it is more work.
+
+You would define two interfaces like this:
 
 ```
 public class IChild {
@@ -62,9 +64,9 @@ public class IParent {
 }
 ```
 
-Note that neither interfaces states that the implementation must reference the other interface, otherwise you would have a circularity in the interfaces.  You could have implementations reference each other if writing JavaScript yourself because you GCC allows more than one top-level 'class' definition in a .js file, where was ActionScript does not.
+Note that neither interfaces states that the implementation must reference the other interface, otherwise you would have a circularity in the interfaces. You could have implementations reference each other if writing JavaScript yourself because GCC allows more than one top-level 'class' definition in a .js file, whereas ActionScript does not.
 
-Anyway, now with these interfaces, the classes look like:
+Anyway, with these interfaces, the classes look like:
 
 
 ```