|
NRecoWeb
Web apps infrastructure overview.
NReco extends standard ASP.NET infrastructure with set of enhancements:
ServicesWebManager defines GetService method for accessing various services from underlying layers: var myPrv = WebManager.GetService<IProvider<string,string>>("myPrvName");Another best practice of using services is declaring dependency inside user controls (just public properties that reflects desired service type). In this case ServiceExpressionBuilder may be used for pubshing services in declarative way: <CTRL:MyUserControl runat="server" MyPrv="<%$ service: myPrvName %>"/> UI ActionsWeb action is a calls from UI layer described by ActionContext. Its purpose to support different aspects (like transactions, logging etc) that usually exist between UI layer and underlying layers. Fore more details refer to web action overview page. Labels ResolvingVery often UI labels should not be static (for instance in case of localization). WebManager defines GetLabel method (overloaded) that may be used for resolving text labels: <%= WebManager.GetLabel("My text") %>In really WebManager tries to locate appropriate label provider using WebManager.GetService method (label provider name may be defined in web manager configuration). This provider should expect LabelContext (that may contain not only original label but also information about label origin etc) and return resolved label value. Note that you can resolve text properties in server controls using LabelExpressionBuilder: <asp:Label runat="server" Text="<%$ label: Label Text %>"/> |
Sign in to add a comment