royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-docs] branch develop updated: fill in app structure
Date Wed, 31 Jan 2018 08:33:07 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new 4aa5979  fill in app structure
4aa5979 is described below

commit 4aa5979924361b34b8cc0de4c5a1cbca3c4bbc39
Author: Alex Harui <aharui@apache.org>
AuthorDate: Wed Jan 31 00:32:58 2018 -0800

    fill in app structure
---
 create-an-application/application-structure.md | 44 +++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/create-an-application/application-structure.md b/create-an-application/application-structure.md
index d386ed1..f3166c7 100644
--- a/create-an-application/application-structure.md
+++ b/create-an-application/application-structure.md
@@ -20,4 +20,46 @@ title: Application structure
 
 # Application structure
 
-*This information will be available soon.*
+Royale applications are usually comprised of multiple files.  If you are in rapid-prototyping
or proof-of-concept "get something small running quickly" mode, you can cram everything into
one file.  But breaking things into multiple pieces often helps you organize or create "separation
of concerns" and as your project and team grows, you and/or your teammates can work on individual
pices independently without stepping on each other's work.  And those pieces often have a
greater chance of  [...]
+
+There are multiple popular ways of dividing up an Application into pieces.  There is Model-View
(MV), Model-View-Controller (MVC), and now other alphabet soup like MVP, MVVM, HMVC and more.
 This documentation will not address these patterns in detail.  You can read more about them
on the internet.
+
+Whatever you decide for how many files you will have, another thing to keep in mind is that
Royale can produce different kinds of output, like SWFs for Adobe FlashPlayer or Adobe AIR
as well as HTML/JS/CSS for browsers as well as Apache Cordova applications.  So, the recommended
practice is to create a folder for your project files and a set of subfolders within.  The
Royale compiler detects certain common folder patterns and automatically chooses where to
put output folders, although yo [...]
+
+Let's say you are creating a project called MyFirstRoyaleApp.  Create a MyFirstRoyaleApp
folder and in it create a folder named "src" and put your source code in there.  If you do
that, the compiler will put the output in a "bin" folder".
+
+If you are going to use Apache Maven to build your app, you can use one of the Maven archetypes,
which put the main application source code 3 levels deep in a "src/main/royale" folder tree.
 Other kinds of files then go in "src/main/resource", "src/main/config" and more.  Maven will
instruct the compiler to put the output in a "target/javascript/bin" folder tree.
+
+Most Royale applications use an MXML file as the main application file.  Other files are
written in MXML or ActionScript depending on whether you are assembling pieces or writing
custom logic.  You can write a Royale Application without using MXML at all, but you'll end
up writing more code.
+
+So, if you decide to use MXML as your main application file, then your folder structure might
look like this:
+
+```
+-MyFirstRoyaleApp
+|-src/MyFirstRoyaleApp.mxml
+```
+
+And after compilation you will see:
+
+```
+-MyFirstRoyaleApp
+|-src
+   |-MyFirstRoyaleApp.mxml
+|-bin
+   |-js-debug
+      |-index.html
+      |-MyFirstRoyaleApp.js
+      |-MyFirstRoyaleApp.css
+      |-(lots of other files)
+```
+
+If you create a production version, you will also see:
+
+```
+|-bin
+   |-js-release
+      |-index.html
+      |-MyFirstRoyaleApp.js
+      |-MyFirstRoyaleApp.css
+```
+

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

Mime
View raw message