News, examples, tips, ideas and plans.
Thoughts around ORM, .NET and SQL databases.

Friday, June 19, 2009

DO4 and Silverlight: will it be easy to make them friends?

Today I've been analyzing this. Briefly, yes - it won't be too complex. Hopefully, 2-3 man-months. Now the details:

1) Dependencies on assemblies which aren't compatible with Silverlight
- Obviously we'll get rid of all the providers except memory provider (in future - file system provider as well).
- It's easy to get rid of Parallel FX as well - actually we don't use it intensively for now.
- The only left one is log4net. Again, quite easy: we use our own logging abstraction layer I'm promising to describe for very long time. In our case logging is fully replaceable.

Btw, there is PostSharp as well, but its 1.5 and upcoming 2.0 versions are ready for Silverlight. So we must migrate to one of them. Most likely, we'll wait for 2.0.

2) Overwhelming Reflection & Reflection.Emit limitations in Silverlight
As it looks like, it won't be too complex. Silverlight limits the reflection only to members your code can access directly, so no any privates or internals. We have lots of internal classes we're reflecting by AssociateProvider (it provides comparers, hashers, size calculators, arithmetics and so on), but actually we've made them internal just because they aren't must be necessarily public. They implement the interfaces AssociateProvider looks for, that's it.

So in majority of cases it will be enough to open such types for public access - they're anyway frequently "hidden" into Internals namespaces.

We also emit lots of code - e.g. whole Tuples infrastructure is build on Reflection.Emit. But AFAIK we never used such things as accessing internal or private members of types we don't emit. Must be checked, of course, but at the first glance it seems relatively easy to fix.

I remember just one place: we make PostSharp to build protected constructors for Entity & Structure ancestors - they look like this one. They're used on materialization. But we can make PostSharp to emit some public static member invoking them as well (specially for Silverlight).

3) Absence of serialization in Silverlight
This is the most complex part. On the other hand, we anyway need fast binaty serialization and currently looking for good approaches there. DO4 already uses serialization few several places, including deserialization of aspects and Metadata.Extension instance storing simplified version of current Storage model (I wrote we use it to make schema upgrade layer to be aware of type-level structure, instead of just table-level structure) and Storage itself (Entities already support serialization by IFormatter). Furthermore, upcoming sync and file system provider also require it.

Our final set of decisions related to serialization is described in this issue. Having it implemented, we'll get fully portable serialization layer.

It seems that's all. If you know any other pitfalls, please notify us. If you're interested in getting Silverlight support, please vote for it in upcoming survey.

9 comments:

  1. Flipkart is Offering Cashback Offers Flipkart Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart Cashback Offers You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart big billion day offers You will get upto 75% Discount

    Flipkart is one of the biggest world wide eCommerce Site flipkart cashback offersso

    Flipkart is one of the biggest world wide eCommerce Site Flipkart hdfc offersso


    ReplyDelete

  2. Flipkart CashBack Offers,telugu bloggers ,telugu websites

    Flipkart CashBack Offers - SBI, HDFC, ICICI, Citibank Cards,flipkart sbi debit card emi,flipkart upcoming offers on mobiles,flipkart credit card,flipkart cashback phonepe,flipkart credit card generator,flipkart cashback offer phonepe,flipkart american express,india fake debit card generator,flipkart american express gift card,sbi credit card offers on flipkart today,sbi flipkart offer,sbi debit card offers cash back,sbi flipkart offer 2018,,telugu bloggers ,telugu websites


    Offers.Flipkart .

    flipkart bank offers,flipkart cash back coupons, flipkart offers,flipkart cashback offers ,flipkart cashback offers,flipkart cash back offers,flipkart cashback coupons,flipkart cashback,Flipkart Cashback Offers,Flipkart Bank Offers, flipkart upcoming offers on mobiles, flipkart hdfc offer, flipkart icici offer,sbi credit card offers on flipkart today,sbi flipkart offer, hdfc credit card offers on flipkart, flipkart upcoming offers on mobiles, flipkart offers


    flipkart today deal offer,flipkart todays deal,flipkart best offer today,flipkart cashback offer today,flipkart mobile app offers today,flipkart mobile deals today

    "Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||" "flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018, sbi credit card offers on flipkart today, flipkart hdfc offer terms and conditions, sbi flipkart offer 2018, flipkart cashback phonepe, flipkart hdfc offer august 2018, flipkart icici offers

    Flipkart CashBack Offers July 2018 - SBI, HDFC, ICICI, Citibank Cards,Cashback Offers Coupons,

    Today Special deals offers


    Flipkart CashBack Offers June 2018 - SBI, HDFC, ICICI, Citibank Cards

    Best of Home Furnishing min 40% off:

    flipkart Mobile Accessories,flipkart Storage devices,flipkart Brands at best prices,flipkart Top Offers,flipkart Fashion for Travel Lovers,FLIPKART Great Offers On Furniture,FLIPKART Discounts for You,flipkart Deals of the Day


    flipkart axis cashback offer,

    flipkart discount coupon codes, flipkartcashbackoffers,

    ReplyDelete