CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

StructureMap is 3 years old

Wow, I completely missed this.  A couple weeks ago was the 3rd anniversary of StructureMap's initial release (I've been coding on something called StructureMap since at lease 2002 though).  Time flies when you're having fun I guess.

By the way, I'm shooting for a StructureMap 2.1 release by the July 4th holiday.  Josh has made some improvements to the configuration, and I've got some little ease of use features to throw in.  I'm also extending the configuration API to add in some of the functionality that you can only do in Xml today.  I've got a backlog of tutorials to write that show under-documented features, especially around configuration profile management that I need to crank out.

Nick Harper asked a while back if StructureMap could do something like Windsor's facilities.  The answer is yes, the Registry class would do the trick just fine.  I'm flirting hard with adding some interceptor support into StructureMap.  I've resisted AOP for a long time, but I'm going to do it this time just to give it a spin and see how it feels.  I'm starting to accumulate some scenarios at work that might be quicker with some declarative interception.  I'll try to build that into the fluent interface API as well. 

- Somebody wanted one node configuration for adding a non-default instance 

- Derik Whitaker is asking for the ability to call internal or private constructors.  This makes me feel dirty, but I'll take a longer look into it Derik.

- Derrick Rapp wants more caching options, but I think I'm going to ask him to contribute here, or write a tutorial on how to plug in your own caching strategies (it's possible out of the box) 

 

If you've got requests, you can add them here or at the StructureMap home page. 



Comments

David Hayden said:

Happy Father's Day, Jeremy!

Does StructureMap work in a Partial Trust Environment that is common in shared hosting? I need a DI Tool that is portable between enterprise and small-to-medium-size web applications. If not, I would love to have this as a feature, even if it is a special build that I can download :)

I think you may have answered this before, but can StructureMap inject dependencies into properties after the object has already been created? I am thinking about the scenario when I have a web page that is already created and then I need a DI tool to inject dependencies into it after it is created.

Thanks!

Dave

# June 17, 2007 6:02 PM

cmyers said:

Jeremy,

Can you write a tutorial about the first 5 minutes of StructureMap after install?

Describe the simplest IoC situation and the minimalist configuration for it.

I finally cracked open StructureMap the other day and I got lost real quick. I think I got it basically working, but it seemed like an awful lot of extra stuff I was doing that I probably didn't need to do, but it wasn't clear to me (admittedly, I'm dumb) how to do the minimal part.

Also, I couldn't find any concrete docs on how to add an interface+concerete for IoC at runtime. I saw you had an example on one of your blog posts, but it didn't seem to work for some reason (I added it, but calls to ObjectFactory.GetInstance<T> would fail, so I must've missed a call to 'Save' or 'Commit' the runtime config changes or something).

Thanks!

# June 17, 2007 6:15 PM

Jeremy D. Miller said:

@David,

Pardon my ignorance, but for partial trust, what do you need?  The second question is not right now, but I could do a little refactoring to make that happen.  Can you email me a little more detail about the exact scenarios?

@Chad,

Look for it tomorrow morning.

# June 17, 2007 7:02 PM

cmyers said:

Jeremy:

Awesome!  Also, while I was using it, I thought of a few API changes/additions (very minor) that would increase usability. I jotted them down at work, so I don't have them on me unfortunately. I'm willing to do the code, I'll look into it and send you an SVN patch file and you can review at your leisure.

Also, about David's partial trust request, depending on what you're doing in the core code of StructureMap (probably nothing too crazy), it might just be enough to mark the assemblies with AllowPartiallyTrustedCallers attribute, but it may involve a little work especially when it comes to some of the file I/O that you're doing with the config files.  I haven't looked at the StructureMap code, so I'm not sure if you'll have a problem with this or not.

Some of these might help:

blogs.msdn.com/.../367390.aspx

msdn2.microsoft.com/.../system.security.allowpartiallytrustedcallersattribute(VS.71).aspx

msdn2.microsoft.com/.../8skskf63(VS.71).aspx

# June 17, 2007 7:16 PM

Jeremy D. Miller said:

@Chad,

Just send me your sourceforge name and you're a committer.

Jeremy

# June 17, 2007 7:23 PM

cmyers said:

Jeremy,

I used the 'Contact me' feature of this blog to reach you, but I'm not sure if you got it (maybe your junkmail filter is blocking it or something?)

My SF.net name is just 'cmyers'. Can you email me at chad <at> hdri <dot> net?

Thanks!

# June 18, 2007 8:22 PM

luca said:

Hi Jeremy,

with SM is possible call generics in this form in config files?

interface IRepository<T, IdT> : IDisposable where T : DomainObject<IdT>{}

thx many!

# July 3, 2007 2:49 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP