c# - Is the promised shared code of a PCL simply a shared area? -
i have created xamarin solution in visual studio 2013 following structure:
solution core / pcl android ios windowsphone
theoretically, platform-specific projects contain gui code (xaml wp, axml android, , whatever ios uses - yet know nothing cupertinian's way of doing things); logic (business , data code, &c) reside in core/pcl folder, each of platform projects referencing that.
however, seems there sort of middle ground: code not gui cannot shared, such printing code , file i/o, , these nostrils of bathing hippo.
iow, core / pcl folder shared, code apparently still needs branched off within that, based on platform/device calling it. put in real estate or sociological terms, core/pcl area multiplex separate private quarters, not common area lions lie down lambs, diversity celebrated, etc.
the promised communal bliss becomes "every man himself" type of compound, armed guards restricting access star-bellied sneeches' area, etc.
what common way handle shared-on-the-surface-but-not-really scenario? dependency injection answer, or...???
update
in fact, based on see here, may separate-code-for-each-scenario isn't possible when using pcl; says there, "because same portable class library shared between multiple applications, platform-specific libraries cannot referenced (eg. community.csharpsqlite.wp7)."
is so? if so, advantage of using pcl reduced, "lowest common denominator" sort of approach, not unlike lambasted-by-xamarin html/javascript approach used rivals such suicidal phonegap ("the ultimate purpose of phonegap cease exist.").
but again, same page says this:
"to extent both disadvantages can circumvented using provider pattern or dependency injection code actual implementation in platform projects against interface or base class defined in portable class library."
so reckon (i live near carmel, "reckon" in [d,r]eference famous of carmelites, clint eastwood) other viable option file-linking (as say: "there 2 major approaches code sharing in manner; file-linking , portable class library (pcl) projects.").
Comments
Post a Comment