Wednesday, October 2, 2013

7. Build, Deploy and Run

What type of app do you want to build?

A social app? An internal app to automate business processes? A game? A communication app? A new utility or device? Each idea would require a different approach to accomplishing their tasks; and so you would create a different development environment for each type of app.

Now imagine if your code and its functionality was in the form of movable objects that you could plug in and remove to configure a new development environment, like Lego's. What ever your ideas, it is nice to have a bunch of components already built that you can simply plug together and configure. It's like designing a new car based on specs of the new vehicle but using many of the same components that the other cars use (bolts, wires, battery, etc).
 

This is the power of using an "MVC" development environment.
"MVC" stands for Model, View and Controller and it has many advantages that I will explain in future blogs.
I use PureMVCa FREE Model-View-Controller Framework for Apache Flex applications.
 

Build, Deploy and Run


Besides the development environment, the way the app is physically built, deployed and ran is also determined by the type of app you want to build. Just like a car, if you built a formula 1 hot rod car, it would be custom built, only deployed at big races and only run on specially prepared raceways. If you manufactured a consumer sports car it would be built using many standard components, deployed through car dealers and ran on highways and paved roads (It's not an off road vehicle).

The same is true for applications. If you were building a game, you might build your app as an iOS app, deploy your app though iTunes and design you app to run on iPhones and iPads.

If you were building a communication app, then the app might be built using standard social components, deployed via multiple App Stores and run on multiple devices (iOS, Android, etc).

Using Apache Flex and PureMVC, you can custom build, deploy and run your application on multiple devices using standard object components.

Build - Client / Server two-way data-flow


There are many components to an application. When an application is run, it usually will need to get information from outside the application. So, it sends data to and from your computer server and/or other third party servers.

On your server, you can use any server database; I use MYSQL because it is FREE and usually already installed on all low cost web hosting packages. I also use PHP as my server language because it also FREE and installed on all low cost hosting packages. MYSQL also has a very powerful and easy way to scale your system up as you grow. MYSQL is owned by Oracle and they have a proven knowledge of managing very large sets of data.


Here is an example of an application sending and getting data that is stored on your server.


The Client app requests data through "PHP Services" (automatically managed by something called the "Zend Framework"). 

Deploy - One Solution, Many platforms


My solution for running on multiple platforms involves creating four projects. One to manage all of your data called the "Model". A second project to automate tests against the Model. And two more to manage the logic and display for both the web and mobile devices (cell phones and tablets).

This is an
application Folder structure example for an application called "services". After you create your four projects, your folder structure will look like the following image.


  • A mobile project to create all apps for mobile and tablet devices.
  • A model file to manage the data (services_model) and generate the library file which the other three projects will use.
  • A model test project to test the library.
  • A swf project to create a swf for HTML display. (optional, if you want your app to run in a browser) 

Using this structure, you can build multiple different file types from many of the same components.

Run - Create "runtime" for specific usage


Your application will either run directly in an operating system or through a browser. When you build your application in Apache Flex, it will automatically configure itself to do this.

Here are three example applications. The first one is a swf running on top of flash player which is on top of a browser. The last two run within Adobe Air.

 
As you can see by the image above; when you run an iPhone app, it is run on top of Adobe Air, which runs on top of Apple iOS.  The iPhone app would be created in the form that iOS expects (an .ipa file).

If you ran the app on a PC or MAC, it would run through the Flash Player (97% of all PC's and MAC's has Adobe Flash Player already installed).
The time period in which the app is running is known as the "runtime".
In future Blogs I will review Market Positioning, Security, Legality, and of course coding!
 
PREVIOUS POST - NEXT POST