Involving the Community

How bout invloving the Community, by letting us contribute to the Codebase.
I would really like to help to extend functionality of the framework and optimize functionality that is already built in.

Are there any suggestions on doing such?

the netmf core is open, jump on over to Codeplex and help out !

(the standard GHI additions are however closed, but there’s an open source stack for the Hydra)

You can contribute and PLEASE do so :slight_smile: Contributions come to GHI and then we can maintain the codebase. Making it open to anyone could mean a messy or unmaintainable codebase.

Of course not everyone is able to make the changes public, but there could be some kind of process to verify and check in the community code by some ghi employee…

I just made some changes on the ModuleCode, I just made all Modules partial and every public method virtual.
By doing so, anyone can extend the code, add their own functionality , even changing the behaviour of a module without messing up the codebase.

So now my question is, how can I contribute these changes to you?
I havent tried just checking in, but Im pretty sure it wont work either :slight_smile:

I wouldn’t consider this as a code contribution but more of a request fro a change on driver, to make functions virtual.

In my personal opinion, this is not needed as the code is open source. And even if it was approved, then why this one driver? It will have to be on every single driver. Therefore, I personally think this is a bad idea. Unless you convince the gadgeteer core team to make this a standard feature in the gadgeteer specifications.

No :slight_smile:
You got me wrong, I try to be a bit more specific :slight_smile:
I made changes to the GHI Module code.
For example the MulticolorLed class.
I made this class partial and all public methods in it virtual.

In my opinion it IS needed, because with that change I can change the behaviour of the MulticolorLed without changing the established codebase.

The point is that I dont want to change your code, I want to extend it.

For example, I wrote a handler for the JoystickModule so I am able to receive an event upon joystick movement. If the joystick class would have been partial I would have been able to extend it by my functionality.

Also if the modules are partial, my changes cant be overwritten by your changes.

What I am saying is that approved changes or contributions are the ones that ate okay with most users. Specific changes are left for users to go separate.

You can email me what you have if you like gusi@ GHI domain

Making all public methods virtual is probably not the best way to create a robust API. Every design choice has it benefits and drawbacks but if I saw an API that had all virtual methods I would be scared as it would be very esy to break :o

I agree with @ Weiti, but If you really want to make a class extensible, and able to be modifed by derived classes, then all protected methods need to be virtual as well.

I agree with Jeff. You can’t override a member that you know nothing about (e.g. it may break if you don’t call the base implementation or do some specific action). So before you override you need to analizy the source code to be sure and it will take some time. If you can’t do something specific you can just write your own class that useses the same logic and gives you the desired result. If you want to extend a class functionality by only adding new members, you can always use composition pattern insted of inheritance (in .net also partial implementation is a kind of inheritance).

@ Jeff why is the api not robust after making everything virtual?
if you would like to create a “StandBy LED” which is fading when turned off you just create a new class,
derive from MulticolorLed and override LedTurnOff, thats it, if it wont be virtual, you have to wrap the whole MulticolorLed…

@ Gralin
Every public method should be pure, as far as I remember every method was pure and so can be easily overwritten.
Also if one overwrites a method without noticing dependencies, he will get the error and probably notice them after :slight_smile: