From commits-return-1837-archive-asf-public=cust-asf.ponee.io@royale.apache.org Wed Jan 31 09:33:09 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CA5A8180662 for ; Wed, 31 Jan 2018 09:33:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BA42F160C35; Wed, 31 Jan 2018 08:33:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0DE32160C25 for ; Wed, 31 Jan 2018 09:33:08 +0100 (CET) Received: (qmail 47436 invoked by uid 500); 31 Jan 2018 08:33:08 -0000 Mailing-List: contact commits-help@royale.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@royale.apache.org Delivered-To: mailing list commits@royale.apache.org Received: (qmail 47427 invoked by uid 99); 31 Jan 2018 08:33:08 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jan 2018 08:33:08 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 34E5781AAF; Wed, 31 Jan 2018 08:33:07 +0000 (UTC) Date: Wed, 31 Jan 2018 08:33:07 +0000 To: "commits@royale.apache.org" Subject: [royale-docs] branch develop updated: fill in app structure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151738758717.8333.15343738737338911117@gitbox.apache.org> From: aharui@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: royale-docs X-Git-Refname: refs/heads/develop X-Git-Reftype: branch X-Git-Oldrev: 82fac120f2bc733c8b2feccf7c7f3fd3eedf2342 X-Git-Newrev: 4aa5979924361b34b8cc0de4c5a1cbca3c4bbc39 X-Git-Rev: 4aa5979924361b34b8cc0de4c5a1cbca3c4bbc39 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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.