{"id":1409,"date":"2014-02-10T23:27:33","date_gmt":"2014-02-10T22:27:33","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1409"},"modified":"2014-02-10T23:31:50","modified_gmt":"2014-02-10T22:31:50","slug":"retegek-kozotti-kommunikacio","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2014\/02\/10\/retegek-kozotti-kommunikacio\/","title":{"rendered":"R\u00e9tegek k\u00f6z\u00f6tti kommunik\u00e1ci\u00f3"},"content":{"rendered":"<p>Tegy\u00fck fel emailt akarok k\u00fcldeni egy weboldalr\u00f3l, amiben linkekeket kell elhelyezni, amik hivatkoznak a weboldal urljeire.<br \/>\nAz email gener\u00e1l\u00e1s a business logic jelleg\u0171 komponensekben van. Ezeknek nem illik kiny\u00falk\u00e1lni HttpContextekbe meg mindenf\u00e9le webes cuccokba, mert \u0151k nem webes cuccok. De ebben az esetben m\u00e9gis csak fel k\u00e9ne dinamikusan der\u00edteni, hol fut a webapp, mert urleket kell gener\u00e1lni.<\/p>\n<p>Ha k\u00e9zzel passzolom \u00e1t a sz\u00fcks\u00e9ges inf\u00f3t, \u00edgy n\u00e9z ki a h\u00edv\u00e1si l\u00e1nc:<\/p>\n<p>ArticleController.ArticleEdit => (innent\u0151l BBL, nem web) IArticleManager.UpdateArticle => INotificationManager.ArticleModified => INotificationFormatter.SendNotification<\/p>\n<p>Na, a NotificationFormatternek m\u00e1r tudni kell urleket gy\u00e1rtani, a felette fut\u00f3 website intrinsic property-jei alapj\u00e1n.<br \/>\nEzt k\u00e9zzel \u00e1tpasszolni a teljes l\u00e1ncon ronda. Mi j\u00f6het m\u00e9g sz\u00f3ba? Statikus v\u00e1ltoz\u00f3k, amit a webapp indul\u00e1sakor pl. a global.asaxben felt\u00f6lt\u00f6k, \u00e9s a BLL-ben kiolvasom? Nem tetszik, de egyszer\u0171. Ut\u00e1lom a statikusokat, sz\u00e9tbor\u00edtanak minden tesztet.<br \/>\nL\u00e9trehozni egy IWebEnvironment interf\u00e9szt, amit a tesztekben fake-elek, \u00e9l\u0151ben pedig szint\u00e9n a web indul\u00e1sakor bet\u00e1razok a DI containerbe? Kicsit k\u00f6rm\u00f6nfont, de ez egy fokkal jobban tetszik.<br \/>\n\u00d6tlet?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tegy\u00fck fel emailt akarok k\u00fcldeni egy weboldalr\u00f3l, amiben linkekeket kell elhelyezni, amik hivatkoznak a weboldal urljeire. Az email gener\u00e1l\u00e1s a business logic&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,75,85,14,10,86,4],"tags":[],"class_list":["post-1409","post","type-post","status-publish","format-standard","hentry","category-net","category-net-4","category-net-45","category-aspnet","category-c","category-mvc","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1409"}],"version-history":[{"count":2,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1409\/revisions"}],"predecessor-version":[{"id":1411,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1409\/revisions\/1411"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}