Powered by Twitter Tools.

June 2006
M T W T F S S
« May   Jul »
 1234
567891011
12131415161718
19202122232425
2627282930  
Chris Donnan

Create Your Badge

Chris Donnan : Programming – Brooklyn Style

software, trading, family, fun

Spring Framework Developer Session .Net Code Examples

Thanks to the ~40 folks that came out last night for our 1st developer session. The night wound up being fairly SpringFramework.net centric. I gave a quickie demo of some code I have been working on for the forthcoming SpringFramework.net Desktop Application Framework.

I also had some requests to post the .net code project I used as an example.
Spring Framework.net demo code

There are a few areas that can be looked at for example purposes.

  • Start by looking in the Program.cs in the SpringPresentation project. This will show you at least the entrance into spring and the top of the object graph with the Main form.
  • Look at the App.config file in the SpringPresentation project. Trace the object graph from the Main Form – to it’s presenter, to it’s commands. Notice how the commands are just added to a generic dictionary – as you add commands – you could just add them to this strongly typed (thanks to generics) dictionary.
  • From there – the commands reference other prototype objects that are what I used as the center of the demo. In essence – our ‘business obejcts’ could be used in a few different ways. We vary the behavior of the business object by injecting different dependencies (strategy like classes in this case).
  • The ComplexBusinessObject.cs file in the library project has a few things in it (this was for convenience in the demo). There are the basic interfaces used to do this business object thing
    • interface IComplexBusinessObject
    • interface IBusinessData
    • interface ICalculator
  • Essentially – ComplexBusinessObject implements it’s interface – IComplexBusiness object by containing strategies that do the real work. These strategies can be passed in – thus allowing you to have different configurations of the same ‘ComplexBusinessObject’. In the spring configuration – you can see that there are ‘Strict’ and ‘Easy’ (arbitrary fake names like all of this demo). These different configurations hand different implementors of the ICalculator interface to make the object do it’s work differently in different circumstances. This type of thing is a prime example of how IoC in general is valuable.
  • The core idea again is that spring assembles these objects for you as needed. It can manage making all of this configurable, flexible etc.

Feel free to comment here with questions etc or email me directly.

Thanks;

Chris

Share and Enjoy:
  • del.icio.us
  • digg
  • blinkbits
  • BlinkList
  • blogmarks
  • YahooMyWeb
  • connotea
  • De.lirio.us
  • Fark
  • Furl
  • Reddit
  • scuttle
  • Shadows
  • Smarking
  • Spurl
  • TailRank
  • Wists

No Responses to “Spring Framework Developer Session .Net Code Examples”

  1. Chris Donnan : Programming - Brooklyn Style - Test Drive Development Developer Session - Unit Testing and Mock Objects in .Net and Java, on July 13th, 2006 at 3:53 am, said:

    [...] It is time for the next ‘Developer Session’ in my series … The last one that we did – Spring Framework Developer Session (code,  power point) was a hit – with maybe ~40 people who came out to hear about Spring. [...]

  2. yarezki, on July 15th, 2006 at 11:40 pm, said:

    Very nice code, I tried it and it works. I have small question I wrote two user controls using the same technique as you used for the main form and then put the user controls on the main form. I get cannot resolve the mainController. I am sure the problem is in the config. Do you have an example showing two user controls on a main form.

    Thanks
    Dr Y Arezki

  3. chrisdrop, on July 17th, 2006 at 12:51 pm, said:

    your best bet is to download the anon cvs version of the spring DAF @ springframework.net’s sourceforge site. That has the current working spring Desktop App Framework and what you are looking for.

    -Chris

  4. yarezki, on July 18th, 2006 at 8:43 pm, said:

    Do you have a link for Spring DAF, I tried and could not find it.

  5. yarezki, on July 19th, 2006 at 9:49 pm, said:

    I downloaded it and I could not compile it. I wish somebody could provide a zipped file or an installer.

    Yazid

  6. yarezki, on July 29th, 2006 at 7:48 pm, said:

    I downloaded springDaf and when I tried to compile I get the following files are missing:

    In the UIApplicationContainer, there a reference to class ControlWatcher and I cannot find it.

    Similarly in IUIApplicationContext there is a reference to ViewNavigator and I cannot find it anywhere.

    Could I get a copy of ViewNavigator and ControlWatcher.

    TIA
    Yazid

Comment on this post below

You must be logged in to post a comment.


You can leave a response, or trackback from your own site.