{"id":614,"date":"2010-01-19T10:49:00","date_gmt":"2010-01-19T10:49:00","guid":{"rendered":"\/blogs\/bobb\/post\/Populating-the-ObjectModel-with-ImplicitServer.aspx"},"modified":"2010-01-19T10:49:00","modified_gmt":"2010-01-19T10:49:00","slug":"populating-the-objectmodel-with-implicitserver","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/","title":{"rendered":"Populating the ObjectModel with ImplicitServer"},"content":{"rendered":"<p>\nNow that you know the StreamInsight metadata (see inside the metadata), its fairly easy to take apart the implicit model because you already know which objects are being created for you. In the implicit development model, you:\n<\/p>\n<p>\n1. Create a CepStream for input &#8211; specifying<br \/>\n&nbsp;&nbsp; EventType as a template parameter<br \/>\n&nbsp;&nbsp; Event Shape (Point, Edge, or Interval)<br \/>\n&nbsp;&nbsp; Factory class of the input adapter<br \/>\n&nbsp;&nbsp; Config info for the adapter<br \/>\n2. Build your LINQ query&nbsp;over the stream<br \/>\n3. Call Stream.ToQuery on input stream &#8211; specifying<br \/>\n&nbsp;&nbsp; Factory class of output adapter<br \/>\n&nbsp;&nbsp; Output configuration<br \/>\n&nbsp;&nbsp; Output event shape<br \/>\n&nbsp;&nbsp; A stream event order\n<\/p>\n<p>\nWhen calling Stream.ToQuery in step 3, the internals have all of the information to build the objects you need. That one call:<br \/>\n&nbsp;&nbsp; Implicitly creates Server and Application<br \/>\n&nbsp;&nbsp; Registers and configures Adapters, QueryTemplate (from step 2), EventType info. <br \/>\n&nbsp;&nbsp; Binds the adapters to the QueryTemplate producing the Query.\n<\/p>\n<p>\nAll you need to do is start the query.&nbsp; Just to prove that the entire object model is in place, you can use the references to navigate from the Query instance back to the Server, and retrieve the diagnostic information, just like in the Explicit Model. Using the ImplicitServer sample&#8230;\n<\/p>\n<p>\nQuery query = ConsumeQuery(top);&nbsp; \/\/ step 3 &#8211; see above, now add the following code.\n<\/p>\n<p>\n\/\/Now, get the Server<br \/>\nServer server = query.Application.Server;\n<\/p>\n<p>\nAt the end of the run, you can use your server instance to get the diagnostic views. Cribbing a little code from the ExplicitServer&#8230;\n<\/p>\n<p>\nRetrieveDiagnostics(server.GetDiagnosticView(new Uri(&quot;cep:\/Server\/EventManager&quot;)), tracer);<br \/>\nRetrieveDiagnostics(server.GetDiagnosticView(new Uri(&quot;cep:\/Server\/PlanManager&quot;)), tracer);\n<\/p>\n<p>\n\/\/ View for your query from Stream.ToQuery<br \/>\nRetrieveDiagnostics(server.GetDiagnosticView(query.Name), tracer);\n<\/p>\n<p>\nThe main differences between this model and the explicit server model are:<br \/>\n&nbsp; Because you&#39;re not instanciating the server, you don&#39;t specify server options or use Server.Connect<br \/>\n&nbsp; Because you didn&#39;t name some of the objects (because you didn&#39;t register them yourself), it would be more difficult to reuse them in a robust manner. If you&#39;re going to go the trouble of trundling through collections or depending on registration order (if this would work), you might as well use the explicit model. If you look at the query.Name, for example, you can see that the implicit model has made the application name &quot;default&quot; and the query name &quot;DefaultQuery&quot;.\n<\/p>\n<p>\nBut its still the same object model.\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that you know the StreamInsight metadata (see inside the metadata), its fairly easy to take apart the implicit model because you already know which objects are being created for you. In the implicit development model, you: 1. Create a CepStream for input &#8211; specifying &nbsp;&nbsp; EventType as a template parameter &nbsp;&nbsp; Event Shape (Point, [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,39],"tags":[],"class_list":["post-614","post","type-post","status-publish","format-standard","hentry","category-sql-server-2008-r2","category-streaminsight"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Populating the ObjectModel with ImplicitServer - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Populating the ObjectModel with ImplicitServer - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"Now that you know the StreamInsight metadata (see inside the metadata), its fairly easy to take apart the implicit model because you already know which objects are being created for you. In the implicit development model, you: 1. Create a CepStream for input &#8211; specifying &nbsp;&nbsp; EventType as a template parameter &nbsp;&nbsp; Event Shape (Point, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2010-01-19T10:49:00+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/\",\"name\":\"Populating the ObjectModel with ImplicitServer - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2010-01-19T10:49:00+00:00\",\"dateModified\":\"2010-01-19T10:49:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server 2008 R2\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2008-r2\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Populating the ObjectModel with ImplicitServer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Populating the ObjectModel with ImplicitServer - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/","og_locale":"en_US","og_type":"article","og_title":"Populating the ObjectModel with ImplicitServer - Bob Beauchemin","og_description":"Now that you know the StreamInsight metadata (see inside the metadata), its fairly easy to take apart the implicit model because you already know which objects are being created for you. In the implicit development model, you: 1. Create a CepStream for input &#8211; specifying &nbsp;&nbsp; EventType as a template parameter &nbsp;&nbsp; Event Shape (Point, [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/","og_site_name":"Bob Beauchemin","article_published_time":"2010-01-19T10:49:00+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/","name":"Populating the ObjectModel with ImplicitServer - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2010-01-19T10:49:00+00:00","dateModified":"2010-01-19T10:49:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/populating-the-objectmodel-with-implicitserver\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"SQL Server 2008 R2","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2008-r2\/"},{"@type":"ListItem","position":3,"name":"Populating the ObjectModel with ImplicitServer"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=614"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/614\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}