Dev-Jam 2006/Object Model

From OpenNMS
< Dev-Jam 2006(Redirected from Object Model)
Jump to: navigation, search

Domain Driven Architecture

more to come

Projects used to Improve the Object Model

DevJam 2005

Changes to the object model based on the "secret project"

Model-Importer

Changes to the object model based on this project.

RRD Performance Improvements

Changes to the object model based on work completed so far in this project.

Note: these are simply examples of some brain storming and we do not intend to eliminate any behavior currently in the project or even believe we have the anything close to implementation ready! The first default configurations in the new design will keep the same single file per data point structure we have now. The examples directory will have tested configurations that offer greater performance. We are going to need lots of coding and testing help for this project. Thanks in advance! --David 16:29, 28 April 2006 (CDT)

We have been refactoring signficant amounts of code working our way into a better object model based on brozow's stated intent for Domain Driven Design. (We have done a lot of this in the blind, sorry) Two contracted projects forced us to move faster down this path which meant not Mavenizing (reorging the code) and not Hibernating (because we would have to change the installer and the database schema and all the database calls in one shot). We leveraged the Model-Importer project to build a JDBC/Spring based object model and DAOs. We are using the RRD performance project to improve the domain model even further. This leads me into djgregor's work to improve filters (rules) or what we are calling IfSelectors.

Packages, Rules, and Repositories

While refactoring the collector for RRD improvement, we realized we need a much richer (deeper) object model; one that normalizes packages and services for the entire system.

If you look at Poller, Collectd, and Threshd, they each implement packages and, for the most part, are very much the same, yet some differences. For example, the Collectd package doesn't define RRD structure and the Poller package does. We want to clean that up a bit and in that process, tidy up a few other issues. In this "deeper" object model, we see IfSelector entities (you can see the beginnings of this in HEAD now) as well as Package entities.

We would like to see packages defined separately and referenced from those configuration files. We also think that "filters" and ranges should be defined separately from packages and referenced from those packages used to create IfSelectors. For example:


IfSelectors:


<selector-configuration>
  <if-selector name="backbone devices">
    <filter>categoryName="backbone"</filter>
    <include-range begin="10.*.254.*" />
  <if-selector>

  <if-selector name="b2b devices">
    <filter>IPADDR IPLIKE *.*.*.*"</filter>
    <!-- btw, I really hate the above filter,
         we should have an all token that is 
         parsed in to 
         select * from ipinterface or something -->
    <include-range begin="172.16.1.1" end="172.17.254.254" />

  <if-selector name="HQ servers">
    <filter>IPADDR IPLIKE *.*.*.*</filter>
    <!-- DJ, throwing this in as a possible suggestion -->
    <class name="org.opennms.filters.FunkyNodes" />
    <!-- this would be pretty cool, too! -->
    <sql statement="select i.ipaddr as ipaddr 
                      from ipinterface i 
                      join node n 
                        on (n.nodeid = i.nodeid) 
                     where n.nodesysoid like '1.3.6.1.4.1.1313.%' />
    <!-- this would be even cooler! -->
    <hql statement="from OnmsNode where sysObjectId like '1.3.6.1.4.1.1313.%' />
  <if-selector>
<selector-configuration>


RRD Repositories:

<repository-configuration>
  <repository name="san" loc-type="fs" location="file:/export/bigolesan/${service}" />

  <!-- Uses DataSourceConnectionFactory -->
  <repository name="oracle" loc-type="dataSource" location="oracle" table-name="perf_data" />
<repository-configuration>


Packages:

<package-configuration>

  <package name="gold"
           if-selector="backbone devices"
           repository="oracle"
           outage-calendar name="quaterly-maintenance" 
           frequency = "300000" >
  <package-configuration>

  <package name="silver"
           if-selector="b2b devices"
           repository="san"
           outage-calendar name="weekly-maintenance" />

  <package name="bronze"
           if-selector="headquarters"
           repository="san"
           outage-calendar name="daily-maintenance" />

</package-configuration>

Please Talk about this and improve this document.--David 16:29, 28 April 2006 (CDT)