Click here to Skip to main content

Leslie Sanford - Professional Profile

@Leslie-Sanford

Summary

63,951
Author
2,559
Authority
3,898
Debator
120
Enquirer
247
Organiser
2,174
Participant
0
Editor
Aside from dabbling in BASIC on his old Atari 1040ST years ago, Leslie's programming experience didn't really begin until he discovered the Internet in the late 90s. There he found a treasure trove of information about two of his favorite interests: MIDI and sound synthesis.
 
After spending a good deal of time calculating formulas he found on the Internet for creating new sounds by hand, he decided that an easier way would be to program the computer to do the work for him. This led him to learn C. He discovered that beyond using programming as a tool for synthesizing sound, he loved programming in and of itself.
 
Eventually he taught himself C++ and C#, and along the way he immersed himself in the ideas of object oriented programming. Like many of us, he gotten bitten by the design patterns bug and a copy of GOF is never far from his hands.
 
Now his primary interest is in creating a complete MIDI toolkit using the C# language. He hopes to create something that will become an indispensable tool for those wanting to write MIDI applications for the .NET framework.
 
Besides programming, his other interests are photography and playing his Les Paul guitars.
Member since Monday, August 5, 2002 (12 years, 2 months)

Contributions

Articles 18 (Legend)
Tech Blogs 0
Messages 1,538 (Master)
Q&A Questions 0
Q&A Answers 0
Tips/Tricks 0
Comments 0

Links

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
GeneralApplying Generic Programming to Runtime Polymorphism PinmemberLeslie Sanford22-Feb-10 10:28 
GeneralGeneric Programming [modified] PinmemberLeslie Sanford19-Jul-08 5:53 
GeneralOff-topic PinmvpRajesh R Subramanian19-Jun-09 12:48 
GeneralRe: Off-topic PinmemberLeslie Sanford19-Jun-09 19:06 
GeneralEnsuring Object State [modified] PinmemberLeslie Sanford27-Jun-07 8:00 
GeneralEvolution of Messaging PinmemberLeslie Sanford19-Oct-06 5:15 
GeneralEnumerators as Synthesizer Components PinmemberLeslie Sanford20-Sep-06 20:53 
GeneralAnonymous Methods as Glue PinmemberLeslie Sanford17-Sep-06 14:30 
I've posted a lot here about flow-based programming. I've studied this from a lot of different viewpoints: Messages can flow between object synchronously or asynchronously. Messages can be pushed from one object to another or pulled to one object from another.
 
For my MIDI toolkit, I settled on a synchronous push architecture using a Source/Sink metaphor. Delegates representing a method in the Sink are connected to a Source. When the Source creates a message, it pushes the message to all Sinks connected to it.
 
This is fine, but the implementation of this approach has felt to me to be non-standard. If you were looking at my libraries for the first time, it might not be obvious what's going on. So I've been thinking of going back to designing my classes in a more traditional .NET framework style.
 
What this means is that the Source infrastructure is done away with. In its place are .NET style events. So instead of a Source pushing messages to its Sinks, it simply raises an event. Sources look just like any other .NET class that raises an event.
 
But this leaves the problem of how to connect objects together. With the Source infrastructure no longer in place, how can sources and sinks be connected?
 
The answer is anonymous methods. Anonymous methods provide a glue that sticks objects together. Let me give you an example:
 
public delegate void MessageReceivedEventHandler(object sender, MessageReceivedEventArgs e); 
 
public class Device 
{ 
    public event MessageReceivedEventHandler MessageReceived; 
 
    // ... 
} 
 
public class Client 
{ 
    public void Send(Message msg) 
    { 
        // Do stuff... 
    } 
} 
 
public class Application 
{ 
    public static void Main() 
    { 
        Device dev = new Device(); 
        Client c = new Client(); 
 
        // An anonymous method connected to the 
        // MessageReceived event. 
        dev.MessageReceived += delegate(object sender, MessageReceivedEventArgs e) 
        { 
            // Delegate the message to the client class. 
            c.Send(e.Message); 
        }; 
 

        // Other stuff... 
    }
} 
 
The Application class creates instances of Device and Client and creates
an anonymous method that delegate events raised by Device to Client. The
anonymous method acts as glue connecting the two objects together.
 
I think this is a form of the Adapter pattern from GoF, but someone pointed out to me on comp.object that it may be the Mediator pattern instead. Regardless, anonymous methods provide a clean way to connect objects together. The beauty is that the classes are completely decoupled. There's no need to provide any special infrastructure for connecting objects; anonymous methods do it for us.

GeneralRefining the approach PinmemberLeslie Sanford22-Jan-06 7:52 
GeneralFlowing down the Sink PinmemberLeslie Sanford21-Jan-06 16:45 
GeneralFlow-Based Programming in C# PinmemberLeslie Sanford29-Dec-05 13:07 
GeneralCombining Visitor, Observer, and Iterator PinmemberLeslie Sanford25-Dec-05 21:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141029.1 | Last Updated 30 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid