Toon posts:

[.NET] Composite UI Application Block, wanneer SmartPart?

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik ben me momenteel aan het verdiepen in het Composite UI Application Block (http://msdn.microsoft.com...us/dnpag2/html/cabctp.asp). Op zich ziet het er veelbelovend en duidelijk uit. Waar ik nog niet helemaal m'n vinger op krijg is; wanneer geef ik een class nou het [SmartPart] attribuut? Wat voegt het toe of dwingt het af als ik dit doe.

In de Hands On Labs exersises (http://www.gotdotnet.com/...95-44ce-a6ca-f2eafbf2653c bij downloads) kom ik het volgende tegen:


Place the following attribute at the top of the CustomerQueueView class.
code:
1
2
[SmartPart] 
public partial class CustomerQueueView : UserControl

This attribute is used to mark the Control as a SmartPart. this is required to support the inversion of control functionality, which will automatically associate service dependencies, controllers etc.

Ik snap alleen niet wat hier precies mee bedoeld wordt.

  • whoami
  • Registratie: December 2000
  • Nu online
Die attribute heeft blijkbaar te maken met Inversion of Control (misschien handig als je eens op deze term zoekt).

Kort gezegd komt het erop neer dat je mbhv Inversion of Control mbhv een configuratie-setting kunt bepalen van welke class je een instance wilt.
In dit geval zal dit dus willen zeggen dat je, mbhv een config file kunt aangeven dat je bv op die locatie in je UI een user-control van het type CustomerQueueView wilt hebben. Je hoeft het dus niet vast te leggen in je code, maar je kan het in een config file vastleggen.

https://fgheysels.github.io/