Design Patterns that work in .NETMF
#1
Posted 28 March 2011 - 07:03 PM
I'm curious about what I can expect from code on the Netduino. Specifically, I'm wondering about what design patterns would play well in this environment.
Currently I'm leaning towards these:
I like Plugins since I'll be adding bits and pieces as I go along (i.e. temp probe, ph meter, solenoid control) so a solid scaffold would be nice. I like MVC because I'm hoping to have multiple input/output options (Web/LCD Shield) for common data.
Am I nuts to head this route in the .NETMF? I'd love to find some good reading on strengths and weaknesses of the .NETFM
Thoughts and comments greatly appreciated.
#2
Posted 28 March 2011 - 09:34 PM
I think it is ideal for this. The version of C# supported on the Netduino is easily rich enough to support all of the well-known design patterns. Regarding strengths and weaknesses, in a nutshell I think of them asAm I nuts to head this route in the .NETMF? I'd love to find some good reading on strengths and weaknesses of the .NETFM
- No generics
- Much smaller libraries (so your favorite library routine might be missing)
- Limited memory (so you need to watch out if you're writing a large program)
- Interpreted .NET rather than compiled (your program will be much slower than it would be on your PC)
#3
Posted 29 March 2011 - 03:50 AM
#4
Posted 29 March 2011 - 04:01 AM
There's nothing wrong with using design patterns but I would caution that you should be very aware of the memory restrictions imposed by this type of platform.Am I nuts to head this route in the .NETMF? I'd love to find some good reading on strengths and weaknesses of the .NETFM
I have used MVC to great effect in regular Windows GUI apps, it really makes the code manageable but then I'm not particularly worried about the size of the executable in that environment.
If the framework brings a lot of extra overhead - either in processing time or memory footprint - you will notice it a lot sooner on the Netduino and then you may be forced to decide between form and function.
Also, as Corey mentioned, some of the things that can make a design pattern a joy to use are missing from NETMF - generics is a good example.
- Adam
#5
Posted 29 March 2011 - 05:07 AM
If the Micro Framework GC works in the same way as the Compact Framework (only one-generation GC), then your choice of design pattern may well have an impact on the GC and therefore overall performance of the application. Something like MVC with long-term objects may not provide the best performance.
Of course this is going to vary from one application to the next - if you're not pushing the processing/memory limits of the device then GC probably isn't going to be a big deal anyway. Just something else to consider ;-)
- Adam
#6
Posted 29 March 2011 - 11:56 AM
#7
Posted 29 March 2011 - 12:22 PM
I'm sort of surprised by the question. I assume that because you're trying to make your code all nice and structured, you'd prefer to implement the design patterns you're talking about with interfaces or delegates/lambdas. Why bother with reflection?I'm having second thoughts about the Plugins interfacing. How well does the device handle Reflection?
To answer your question, it has some of the full-framework Reflection API but several things are missing.
#8
Posted 29 March 2011 - 01:31 PM
#9
Posted 29 March 2011 - 02:35 PM
I'm sort of surprised by the question. I assume that because you're trying to make your code all nice and structured, you'd prefer to implement the design patterns you're talking about with interfaces or delegates/lambdas. Why bother with reflection?
To answer your question, it has some of the full-framework Reflection API but several things are missing.
I was just thinking about dynamic plugin loading. My initial (rough) idea was to pull an available plugin listing, look for any marked 'active' and instantiate them at runtime. I'll take a look at the delegate route, as that really does make more sense.
#10
Posted 18 April 2011 - 10:51 AM
Now I just have to wait for canakit.com to ship my device....
Hi Corey, I'm curious to find out if you have recieved your unit yet. I purchased a Netbuino plus from Canakit back in February it was shipped to me after the restocking bin March. However, today I have received an import bill from UPS for almost as much as I paid for the unit, with the explanation that they had shipped it from Canada.
Did you have a similar experience? Has anyone else been hit with such a surprise when ordering from a European Website?
--Dave
#11
Posted 18 April 2011 - 08:51 PM
Hm? I'm guessing this question was directed at H07R0D rather than me.Hi Corey, I'm curious to find out if you have recieved your unit yet.
#12
Posted 18 April 2011 - 09:50 PM
Hi Corey, I'm curious to find out if you have recieved your unit yet. I purchased a Netbuino plus from Canakit back in February it was shipped to me after the restocking bin March. However, today I have received an import bill from UPS for almost as much as I paid for the unit, with the explanation that they had shipped it from Canada.
Did you have a similar experience? Has anyone else been hit with such a surprise when ordering from a European Website?
--Dave
Dave, I ordered mine from Canakit as well. Mine was shipped via the postal service and I haven't been hit with any import duties (yet). Keep us posted on what goes on with this please. The outcome from this will effect where I order from in the future.
-dan
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users