开发者

Xcode project management: single engine - different personalized applications

The idea is that I have an application template that should be customized for different clients. The main goal is to provide a number of personalized applications with almost the same functionality.

What is the best approach of Xcode project organization (and maybe management) in order to achieve the following points for each client's application:

  1. Always different images set for visual elements (for controls, views, icons etc);
  2. Rarely different XIB files for small UI structure modification;
  3. Visual customizations - code level;
  4. Small functional modifications;
  5. Possibility to switch back to previous personalized versions;
  6. One functional engine (e.g. search functionality);

At the moment, for every personalization request I create in the same project's root directory new project file, and corresponding XIB files, images set and source files (fo开发者_JAVA技巧r some functional requests) directories. Each project file has a reference to the main source files directory (engine).

But I suppose that's not the best way to organize this type of projects.


I'd probably choose to do this sort of thing using version control, and keep separate branches for each customised version. That way, the master/trunk can be your uncustomised code.

When you need to create a customised version, simply create another branch. If your core app needs to change, merging the changes from trunk into the branches should be straightforward, and this gives you the advantage of keeping all the customised code/files separate.

I don't know how easily this would fit into your workflow, but I think it ticks all the boxes, including being able to switch back to previous versions.


create a project template -- or just a zip file with the template.

first, determine where you can use (something such as) xml defs instead of overriding and other source level changes.

Always different images set for visual elements (for controls, views, icons etc);

add placeholder resources to the project template

Rarely different XIB files for small UI structure modification

add it to the project, referring changes (if it's changed) via vc

Visual customizations - code level;

core libraries, shared across all projects. consider using c or c++ if the library will be large. objc cannot be stripped. this contains implementation stubs, as well as common code, base classes, and interfaces.

Small functional modifications

extend the interface of your core classes so the subclasses may easily implement the frequent alterations. these files are part of the template.

Possibility to switch back to previous personalized versions;

it should be in vc, and the dependency versions should also be tracked.

One functional engine (e.g. search functionality);

an undefined factory function is simple enough:

id<MONSearchEngineProtocol> MONAppCoreCreateSearchEngine();

declare it in the static lib, but define (and implement what is necessary) in one of the project specific sources. you can add this other places - some people would stuff it in the app controller and override it.

if you have a lot of these to manage, consider moving your resources to code (rather than managing a ton of nibs). a nib defines a lot of code -- which is a lot of nearly duplicate code to manage. this will make sense for some resources, and not much sense for others.


Create a static library with all of your base functions. Then every project can link to this static library. It means if you find a bug you only have to fix it once, and just rebuild all client programs.


Use Xcode's targets. You can specify different resources and/or source files to be included in one target.

If you want to have multiple code-customizations in one file, define a compiler-macro for every target and use #ifdef MY_MACRO to include code for that specific target.


You can make alot of content management by using xml for providing content. ex. if you want a image different graphics for either ipad or ipad you can create a tag something like this:

<MyLogo logoID="0">
<ipad image="someImage2X" height="50" width="50" position="100, 100"/>
<iphone image="someImage2" height="50" width="50" position="100, 100"/>
</MyLogo>

And then ofcourse create a parser for the xml. This you can create many different products of same type with different content.

Also check for device/content you are working on, and then parser to correct tag for your needs.

Hench: You can create different xml attributes for different effects, as long as you have implemented the core functionality for the effect.

Happy coding


For Multiple Code Customizations in one file use - Compiler Macros (Do Define and Use).

You can use X-Code Targets but I know this won't be of much help.

I've started working on it too. :-)

Happy XCoding

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜