[mono-android] Sharing code between iOS, Android and Windows Phone

Miljenko Cvjetko mcvjetko at holisticware.net
Tue Nov 8 04:40:47 EST 2011


Hi

On 2011.11.08 01:01, Steven Pack wrote:
> Thanks all. Sharing the code, not the binary. Got it. Makes sense.
Few years ago, when there was no Project Linker, it was possible to reuse
Silverlight assembly in WPF project, but with tweaking IL, assembly, 
build parameters
etc. (cannot remember exactly). Our local MVPs hated my guts for allways 
asking
what it the status on this matter (code reuse).
This was just not feasible, OTOH adding source code as links was tedious 
for even
mid-sized projects. Until Project Linker came. Project linker is a tool 
that came out
as result of Prism Project (MS Patterns and Practices) which is based on 
idea of
sharing as much as possible code between platforms. Though they concentrate
on Silverlight and WPF (recently WP) to share c# (and xaml too) the 
principles can
be applied further on MonoTouch and Mono4Android.
The only stuff that is not possible right now is to stick with MVVM 
pattern, bacuse
of lacking databinding support in Mono* (but this will change too) and 
Prism relies
heavily on it.

>
> Thanks for the detailed samples and write-ups. Very helpful.
Thanks, there is more to come as we learn, but real thanks shoudl go to 
those Monoists
that made all this possible...

We are working on another open-source project Composite C1 CMS system 
and waiting
for release of v 3.0 in few days, that is the reason some other texts 
and newer versions
of those are not out yet. We hope in few days they could reach the light 
of the day.

greetings

mel
>
> Steve
>
> From: Miljenko Cvjetko <mcvjetko at holisticware.net 
> <mailto:mcvjetko at holisticware.net>>
> Organization: HolisticWare
> Reply-To: <mcvjetko at holisticware.net <mailto:mcvjetko at holisticware.net>>
> Date: Tue, 08 Nov 2011 00:01:21 +0100
> To: Discussions related to Mono for Android 
> <monodroid at lists.ximian.com <mailto:monodroid at lists.ximian.com>>
> Cc: Steven Pack <steven_john_pack at yahoo.com.au 
> <mailto:steven_john_pack at yahoo.com.au>>
> Subject: Re: [mono-android] Sharing code between iOS, Android and 
> Windows Phone
>
> Hi
>
> On 2011.11.07 08:16, Steven Pack wrote:
>> Hi All,
>>
>> I'm using Xamarin, specifically because I'd like to share as much 
>> code as possible between the platforms. I've noticed I can only 
>> reference library projects that target "Mono for Android x.x". I'd 
>> hoped to be able to simply create a Mono class library and only use 
>> the classes supported by MonoDroid or MonoTouch and reference said 
>> project from either platform.
> Our team does it with single solution and projects for each platform 
> and shares on source
> code level with links to source files (cs, xaml etc) not IL (by 
> referencing assemblies).
>
> Architectural only 2 layers Business Logic BL and Presentation Layer 
> PL with
> assemblies per platform... Controlers and ViewModels in MVC and MVVM 
> can be
> moved to those assemblies...
>
>   * Business logic (BL) per platform linked with Project Linker.
>       o Starting with WP7x project as "smallest common denominator -
>         subset"
>         (because of various restrictions - Android Mono4Android and iOS
>         MonoTouch are still in front).
>       o all projects have WP7 project as "linked source project"
>         (Project Linker terminology)
>         meaning code in them/their folders is just a link to cs file
>         in WP7x prj
>   * Presentation Layer PL dlls (User Control library project types)
>       o our team uses them for reusing
>           + some UI code if it can be shared across projects
>           + xaml controls (write up is on the way).
>       o MonoDroid - does not apply cos layouts from other
>         assemblies cannot be used - yet
>   * Presentation Layer EXEs - main entry points - per platform
>   * Unit testing Projects
>       o if Windows Forms BL assembly reuses bunch of WP7x code and adds
>         some more, then NUnit test for WF or WPF project will cover a
>         lot from
>         WP7x and You are not stuck with WP7 based UnitTesting in emulator
>
> These below are our working notes on recommendation for solution and 
> project
> structure and naming...
> Team is still working on it and it is far from stable, but You could 
> get the idea...
> http://www.holisticware.net/HolisticWare/Know-How/Development/Visual-Studio-Project-Structure.aspx
> Numerical stuff is just to have projects ordered in Solution Explorer, 
> because with growing
> number of platforms and more architectural layers.
>
> Project Linker exclusion
> http://www.holisticware.net/HolisticWare/Know-How/Development/visual-studio-project-linker.aspx
>
> ... and we are moving our site to new version, so bunch of texts is 
> waiting to be published...
>
> HTH
>
> regards
>
> mel
>
>
>>
>> What am I missing here? How does one go about sharing code?
>>
>> Steve
>>
>>
>> _______________________________________________
>> Monodroid mailing list
>> Monodroid at lists.ximian.com
>>
>> UNSUBSCRIBE INFORMATION:
>> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
> -- 
> Miljenko Cvjetko dipl.ing. ET
> 	Direktor/CEO
> 	Projektant rješenja/Solution Architect	
> 	Razvojni programer/Senior developer
> 	Voditelj projekta/Project Manager
>
> IX južna obala 13
> Kajzerica Zagreb
> T: 385 1 7775555
> M: 385 91 557 447 3
> F: 385 1 7779556
> e:mcvjetko at holisticware.net
> w:http://www.holisticware.net


-- 
Miljenko Cvjetko dipl.ing. ET
	Direktor/CEO
	Projektant rješenja/Solution Architect	
	Razvojni programer/Senior developer
	Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://www.holisticware.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111108/57480fb5/attachment-0001.html 


More information about the Monodroid mailing list