[mono-android] [MonoTouch] sharing code between mono touch and mono for android

Miljenko Cvjetko mcvjetko at holisticware.net
Tue Feb 28 09:27:09 UTC 2012


Hi

On 2012.02.28 09:56, James Briant wrote:
>
>
> On Tue, Feb 28, 2012 at 12:50 AM, Miljenko Cvjetko 
> <mcvjetko at holisticware.net <mailto:mcvjetko at holisticware.net>> wrote:
>
>
>     Why would partial classes be problem?
>     It is just splitting code into  multiple files
>
> Its no different than having #if/#endif, which you agreed was bad in 
> your earlier email. But instead of the compiler hitting an #if and 
> ignoring what's next, the compiler is never given the file in the 
> first place. Its no different.
I see it differently.
SomeClass.MTch.cs is not in WP7 project it is added as delta in MTch project
SomeClass.M4A.cs is not in WP7 or MTch project it is added as delta in 
M4A project

SomeClass.cs is pressent as normal file in WP7 project and as link in other.

.. so everthing is given to compiler in every project! No ifdefs (they 
are almost like gotos for me)


> "I can't do what I want with the compiler, so I'll do it with a 
> preprocessor or makefile".
Or Build Action: something that does not compile
We don't have that either...

When file or link is there - it compiles!

> Basically you're building three classes that have the same name but 
> are different. Its a hack.

or am I extending one class across multiple files w/o hack - just plain 
organization/management??

I can remember STL requirements (rules and recommendations) with ctor, 
cctor (copy),
assigment op, less, equals and other derived relational ops for class.
Today I write something similar too in SomeClass.Operators.cs and see no 
evil!

Not speaking that in not-linked-file in WPF/WF project I can write 
SomeClass.Serializable

[Serializable]
public partial SomeClass {} // that's all I have desktop serialization 
only on desktop project!!

cos Attributes and some keywords (abstract) are additive accross partial 
classes.

the only problem I see with my approach:
I have to determine "platform smallest common subset/denominator of 
features" and that is
WP right now. If microsoft decides to add almost everything what is on 
desktop and maybe
something from asp.net (this will not happen) and I find it usefull and 
put asp.netserver in
my mobile app (this will not happen too - for a long time) then WP 
(silverlight) is not smallest
subset, so I have to reorganize my projects...
Until then MT and M4A are feature-supersets of WP-SL for me...

regards

mel

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

IX juz(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/20120228/3df9143c/attachment-0001.html>


More information about the Monodroid mailing list