PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: Elephant on May 03, 2013, 11:41:40



Title: Managing Class Inheritance Across Platform-Dependent Libraries
Post by: Elephant 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.


Title: Re: Managing Class Inheritance Across Platform-Dependent Libraries
Post by: puremvc 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>