Implement same domain model in Python and C# - What should be the same and what should vary? -
i am, hobby , best-practice exercise, implement same domain model (a simple gps / gis library, inspired in iso 191xx stardards , ogc abstract model) both in python , c#.
it first, tought: "well, iso/ogc gave me finished uml, have each class in c# , in python have same signature".
i found myself stuck in "strict/static vs duck typing" problem, since cannot count on method signatures in python. example:
- overloading constructors quite common , natural in c#, in python have resort
*args **kwargs, conditionals; - properties encouraged in c#, source code have seen around in python tend set fields directly, although use of
@propertyorproperty()quite straightforward. - (and on).
actually there (obviously) obvious , documented "difference in mindsets" between 1 language , other, , respect differences while @ same time ending "the same" application, is, equivalent domain model, architecture , functionality.
so question is:
if implement same abstract model ("uml-like") in python , c#, how should proceed, , specifically, constructs should invariant, , should different?
what called "abstract model" in mda called platform independent model (pim), , implementation in c# and/or python called platform specific model (psm). supposed there exist tranformations/code-generators pim psm's, depending on how these code-generations work appropriate c# , python source code. usually, such tools provide means control code generated. , such control done via pim annotations specific psm generating. hope helps.
Comments
Post a Comment