{"id":801,"date":"2003-04-11T22:52:00","date_gmt":"2003-04-12T07:52:00","guid":{"rendered":"http:\/\/www.cloudidentity.com\/blog\/2003\/04\/11\/webservice-usage\/"},"modified":"2013-03-16T13:02:24","modified_gmt":"2013-03-16T22:02:24","slug":"5441","status":"publish","type":"post","link":"https:\/\/www.cloudidentity.com\/blog\/2003\/04\/11\/5441\/","title":{"rendered":"WebService Usage"},"content":{"rendered":"<p><P><FONT face=\"Arial\" size=\"2\">           Hmm.<\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\">Always for the sake of clarity, I believe that some<br \/>\nmore words should be spent on in which sense WSs &#8220;are another layer in a<br \/>\nmulti-layer architecture&#8221;&#8230; They introduce some kind of factorization of the<br \/>\nenterprise ecosistem, sure: however I&#8217;d say that their taxonomy is somewhat<br \/>\northogonal to the tier one. They are deeply different in purpose: just think at<br \/>\nall the orchestration patterns that WS leverages as opposed to the rigid roles<br \/>\nthat carachterize the PLBLDAL.<\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\">I think that the key concept here is that the design<br \/>\nof a business object is supposed to be done exactly like in the past: having WSs<br \/>\ntoday allow you to gather a functional team of objects(components?)&nbsp;that,<br \/>\ntaken together, supply (guess what?) a <U>service<\/U>. Such objects can be from<br \/>\nboth the BL and the DAL, hence the orthogonality. <\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\">Regarding the embedding of business logic in the web<br \/>\nservice: since the WS supply a different coarseness in the offered functionality<br \/>\nand can have to coordinate the interaction of different lower level objects, I<br \/>\nbelieve it&#8217;s perfectly reasonable that such coordination could imply a centain<br \/>\ndose of (business) logic. It&#8217;s not wasted by any mean: by scale selfsimilarity,<br \/>\nthis could be equivalent to say that the orchestration logic among WSs of one<br \/>\nenterprise process is &#8220;wasted&#8221; as well.<\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\">I&#8217;m afraid that, more than the articles that for sake<br \/>\nof simplicity fail to supply a canonical concept of service, the problem is that<br \/>\nit&#8217;s not entirely clear what a service architecture overimposed on a old fashion<br \/>\none can do for the enterprise: we have the mean before&nbsp;having an exact<br \/>\nidea&nbsp;of what&nbsp;what we can achieve with that mean. Such goals are, very<br \/>\noften, more business related than&nbsp;pure technical stuff: so the typical<br \/>\nsituation is that who has the skin in the game&nbsp;can&#8217;t yet think in term of<br \/>\nservices and since he can&#8217;t think in such term he can&#8217;t as well see the<br \/>\n(enormous) advantages specific to his business.<\/FONT><\/P><br \/>\n<P>Sorry if my bad English messed up the meaning \ud83d\ude42<\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\"><EM>I saw <\/EM>  <A href=\"http:\/\/dotnetweblogs.com\/jlerman\/posts\/5407.aspx\"><EM>Julie&#8217;s post<\/EM> <\/A><EM> that took me to <\/EM>     <A href=\"http:\/\/dotnetweblogs.com\/ahoffman\/posts\/5401.aspx\"><EM>Alex&#8217;s post<\/EM> <\/A><EM> and I really like this<br \/>\nsubject.&nbsp; However, I don&#8217;t totally agree.<\/EM><\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\"><EM>I<br \/>\ndefinitely agree that WebServices are another layer in a multi-layer<br \/>\narchitecture.&nbsp; What I don&#8217;t totally agree with is that there should be no<br \/>\nlogic in a WebService.&nbsp; That it should only act as an &#8220;interface&#8221;<br \/>\nlayer.&nbsp; I think in a perfect world, where everybody follows best practices<br \/>\nand has all the time they need to do projects, this would be the way to<br \/>\ngo.&nbsp; A lot of companies have to weigh &#8220;the best way to do something&#8221; vs.<br \/>\n&#8220;the fastest and most cost effective way to do something&#8221;.&nbsp; A lot, I would<br \/>\nguess, decide that if the business logic is small enough and will never be<br \/>\nreused, that it would be better to just throw it in the WebService.&nbsp; The<br \/>\nmore OOP-like you make an application, the easier it is to update in the<br \/>\nfuture.&nbsp; It also goes the other way though, and can&nbsp;make updating more<br \/>\ntedious.<\/EM>   <\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\"><EM>The<br \/>\nlast project I worked on (that&#8217;s not quite done yet actually) had about 1500<br \/>\nlines of code in it.&nbsp; Basically though, all the logic in the WebService is<br \/>\nreally just to &#8220;shape&#8221; the data that comes from my DAL.&nbsp; Should I move all<br \/>\nthat shaping code into another Assembly or even just another class?&nbsp;<br \/>\nMaybe.&nbsp; If I don&#8217;t, am I screwing myself over in the future?&nbsp; Not<br \/>\nreally.<\/EM>                                                                    <\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\"><EM>I just<br \/>\nthink that there&#8217;s no difference in programming practice between say WebForms,<br \/>\nWebServices &amp; WindowsForms (besides the fact that WebServices don&#8217;t have<br \/>\nUI).&nbsp; It&#8217;s a &#8220;best practice&#8221; to not have any business logic in your UI (or<br \/>\nin your WebService, stated by Alex), but does everyone follow that?&nbsp; Not at<br \/>\nall.&nbsp; Again, I believe the reason being, simply because of time and<br \/>\nweighing the benefits.<\/EM>                                                                 <\/FONT><\/P><br \/>\n<P><FONT face=\"Arial\" size=\"2\"><EM>That<br \/>\nsaid, I agree with Alex, that business logic should be outside of your &#8220;layer<br \/>\ninterface&#8221;.&nbsp; I don&#8217;t think, however, that if you don&#8217;t do it that way, you<br \/>\nshould be looked at as someone who doesn&#8217;t know what they&#8217;re doing.&nbsp;<br \/>\nSituations vary.<\/EM>                                          <\/FONT><\/P>[<a target=\"_blank\" href=\"http:\/\/dotnetweblogs.com\/eporter\/posts\/5422.aspx\">HumanCompiler<\/a>]<\/p>\n<div style=\"clear:both\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hmm. Always for the sake of clarity, I believe that some more words should be spent on in which sense WSs &#8220;are another layer in a multi-layer architecture&#8221;&#8230; They introduce some kind of factorization of the enterprise ecosistem, sure: however I&#8217;d say that their taxonomy is somewhat orthogonal to the tier one. They&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[61],"tags":[],"class_list":["post-801","post","type-post","status-publish","format-standard","hentry","category-architecture-ws"],"_links":{"self":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/801\/revisions"}],"predecessor-version":[{"id":1950,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/posts\/801\/revisions\/1950"}],"wp:attachment":[{"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/categories?post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudidentity.com\/blog\/wp-json\/wp\/v2\/tags?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}