Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
October 19, 2017, 02:52:31 PM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: Managing Class Inheritance Across Platform-Dependent Libraries  (Read 4334 times)
Elephant
Newbie
*
Posts: 9


View Profile
« on: May 03, 2013, 11:41:40 AM »

I could use some advice on managing my class structure.  My project is quite complex -- it has five projects (all using Flex):

Desktop
Mobile
Web
CommonLib
AIRLib

About 90% of the current application functionality is in the CommonLib, with AIR API calls happening in AIRLib.  The three "display" projects kick off the STARTUP notification by doing:

Code:
CommonFacade.getInstance().startup(this);

Some of our Proxy classes use flash.filesystem.File functionality if available:

Code:
private var localData:LocalDelegate = ReflectionManager.createLocalDelegate();
private var appVO:AppVO;
public function loadAppData():void {
  if (localData) {
    appVO = localData.loadData();
  } else {
    appVO = remoteData.loadData();
  }
etc...

Currently, the Desktop and Mobile projects call something like 
Code:
ReflectionManager.setLocalDelegateClass(LocalFileDelegate);

This pattern has worked reasonably well so far, but I'm wondering if there isn't a better way.  I notice that we don't have *any* PureMVC-aware code in our AIRLib project, and my current task might go more smoothly if we did.

I'm getting some data from a native extension for iOS and Android that needs to be shown on a view in CommonLib.  It would be nice and simple to have that data come in on a Notification, but it doesn't cleanly fit into any existing classes in the application.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #1 on: May 06, 2013, 07:41:06 AM »

A project I've been working on for a couple of years now has:

- Web creation tool
- Web viewer
- Desktop Viewer
- iPad Viewer
- Android tablet viewer

The libs break down like this:

- LibInhouse - everything that is sharable between all the above projects
- LibAir - everything that is sharable only between desktop and mobile projects
- LibMobile - everything that is sharable only between the mobile projects

PureMVC is everywhere in these libs and application projects.

-=Cliff>
Logged
Pages: [1]
Print
Jump to: