PrismLibrary and Unity containers examples

PrismLibrary and Unity containers examples

Anonymous
Not applicable
1,089 Views
6 Replies
Message 1 of 7

PrismLibrary and Unity containers examples

Anonymous
Not applicable

I wondered if anyone knows of an example that utilizes PrismLibrary 6 or 7 and the concept of unity containers for Revit addins. All examples I have googled uses "Application" as example. Any help would be huge.

0 Likes
1,090 Views
6 Replies
Replies (6)
Message 2 of 7

Kennan.Chen
Advocate
Advocate

I have little knowledge about PrismLibrary and Unity containers, so I did some quick reading of the github repos.

 

For the PrismLibrary, I noticed this library provides the ability to create loosely coupled MVVM modules. I do think it can be well managed by some Reflection code. I included some of my ideas in the demo.

 

If you mean containers for Inverse of Control by Unity containers, actually I have adopted my own simple container implementation in my production code. It's not that complicated with some knowledge of Reflection. It can also provide the ability to create loosely coupled business modules.

 

For more details, check the attachment.

 

Hope it helps!

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thank you! I will study it.

0 Likes
Message 4 of 7

Anonymous
Not applicable

Sorry, that i have to reopen that Question.

Why would you use Reflection or IoC? I am familiar with both. I would get that you would use IoC to create a loosly coupled Project or are there more benefits? Why would u use Reflection?

 

I'm also aiming to work with MVVM and Prism to create an Application for Revit.

 

Best Regards,

 

Anton S.

0 Likes
Message 5 of 7

Kennan.Chen
Advocate
Advocate

Yes, I use IoC mainly to create a loosely coupled project which makes every part of my project replacable. And I believe it's a good practise for interface oriented programming which is the core concept of decoupling. Reflection is just a necessary tool if you want to implement a IoC container yourself as the main job of an IoC container is to return an instance according to a type.

0 Likes
Message 6 of 7

Anonymous
Not applicable

Thank you Kennan!

0 Likes
Message 7 of 7

jasonprichardtcc
Contributor
Contributor

Anschlei-

Did you have any further success implementing the Prism framework in Revit?  I am trying to do the same, ideally using a dockpanel page as the shell (using Unity).  The issue I’m finding is that I can’t seem to override the shell dependency object to a page instead of a window.  This may just be my inexperience!

 

 

0 Likes