Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Managing Class Inheritance Across Platform-Dependent Libraries  (Read 9245 times)
Elephant
Newbie
*
Posts: 9


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

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:

:
CommonFacade.getInstance().startup(this);
Some of our Proxy classes use flash.filesystem.File functionality if available:

:
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 
:
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 Email
« Reply #1 on: May 06, 2013, 07:41:06 »

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