Index: sansmodels/src/sans/models/BaseModel.py
===================================================================
--- sansmodels/src/sans/models/BaseModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/BaseModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+"""
+    This software was developed by the University of Tennessee as part of the
+    Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+    project funded by the US National Science Foundation.
+
+    If you use DANSE applications to do scientific research that leads to
+    publication, we ask that you acknowledge the use of the software with the
+    following sentence:
+
+    "This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+    copyright 2008, University of Tennessee
+"""
+
+""" 
+    Provide base functionality for all model components
+    
+    The following has changed since going from BaseComponent to BaseModel:
+    
+        - Arithmetic operation between models is no longer supported.
+          It was found to be of little use and not very flexible.
+        
+        - Parameters are now stored as Parameter object to provide 
+          the necessary extra information like limits, units, etc... 
+"""
+
+# imports   
+import copy
+   
+class Parameter(object):
+    """
+        Parameter class
+    """
+    name  = ''
+    value = 0.0
+    def __init__(self, name, value):
+        self.name = name
+        self.value = value
+        
+
+class ParameterProperty(object):
+    """
+        Parameter property allow direct access to
+        the parameter values
+    """
+    def __init__(self,name,**kw):
+        self.name = name
+       
+    def __get__(self,instance,cls):
+        return instance.parameters[self.name].value
+
+    def __set__(self,instance,value):
+        instance.parameters[self.name].value = value
+
+
+   
+from ModelAdaptor import ModelAdaptor
+
+class BaseModel(ModelAdaptor):
+    """ 
+        Basic model component
+    """
+    ## Name of the model
+    name = "BaseModel"
+    ## Dictionary of Parameter objects
+    parameters = {}
+
+    # Evaluation methods to be implemented by the models
+    def run(self, x=0):  return NotImplemented
+    def runXY(self, x=0):  return NotImplemented
+    
+    def __call__(self, x=0):
+        """     
+            Evaluate the model. Equivalent to runXY(x)
+            @param x: input value
+            @return: value of the model
+        """
+        return self.runXY(x)
+    
+    def clone(self):
+        """ Returns a new object identical to the current object """
+        
+        obj = copy.deepcopy(self)
+        obj.params = copy.deepcopy(self.params)
+        obj.details = copy.deepcopy(self.details)
+    
+        return obj
+    
+    def setParam(self, name, value):
+        """ 
+            Set the value of a model parameter
+        
+            @param name: name of the parameter
+            @param value: value of the parameter
+        """
+        # Lowercase for case insensitivity
+        name = name.lower()
+        return object.__setattribute__(self, name, value)
+        
+    def getParam(self, name):
+        """ 
+            Set the value of a model parameter
+
+            @param name: name of the parameter
+            @param value: value of the parameter
+        """
+        # Lowercase for case insensitivity
+        name = name.lower()
+        return object.__getattribute__(self, name)
+        
+    def getParamList(self):
+        """ 
+            Return a list of all available parameters for the model 
+        """
+        param_list = self.params.keys()
+        return param_list
+        
+    
+if __name__ == "__main__":
+    b = BaseModel() 
+    print b.operateOn
+    
Index: sansmodels/src/sans/models/ModelAdaptor.py
===================================================================
--- sansmodels/src/sans/models/ModelAdaptor.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/ModelAdaptor.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+"""
+    This software was developed by the University of Tennessee as part of the
+    Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+    project funded by the US National Science Foundation.
+
+    If you use DANSE applications to do scientific research that leads to
+    publication, we ask that you acknowledge the use of the software with the
+    following sentence:
+
+    "This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+    copyright 2008, University of Tennessee
+"""
+
+""" 
+    Provide base functionality for all model components
+    
+    The following has changed since going from BaseComponent to BaseModel:
+    
+        - Arithmetic operation between models is no longer supported.
+          It was found to be of little use and not very flexible.
+        
+        - Parameters are now stored as Parameter object to provide 
+          the necessary extra information like limits, units, etc... 
+"""
+
+class ParameterDict(dict):
+    """
+        Parameter dictionary used for backward 
+        compatibility between the old-style 'params'
+        dictionary and the new-style 'parameters'
+        dictionary.
+    """
+    def __init__(self, parameters):
+        """    
+            Initialization
+            @param parameters: new-style 'parameters' dictionary
+        """
+        self.parameters = parameters
+        
+    def __setitem__(self, name, value):
+        self.parameters[name].value = value
+    
+    def __getitem__(self, name):
+        return self.parameters[name].value 
+    
+class ModelAdaptor(object):
+    """ 
+        Model adaptor to provide old-style model functionality
+    """
+
+    def __init__(self):
+        """ Initialization"""
+        ## Dictionary of parameters, available for backward compatibility
+        self.params = ParameterDict(self.parameters)
+        ## Additional details, provided for backward compatibility
+        self.details = {}
+        
+        ## Dictionary used to store the dispersity/averaging
+        #  parameters of dispersed/averaged parameters.
+        ## Provided for backward compatibility
+        self.dispersion = {}
+           
+    def __getattribute__(self, name):
+        """
+            Provide additional information when accessing old-style
+            data members.
+        """
+        if name in ['operateOn', 'other']:
+            raise AttributeError, "Model operation are no longer supported"
+
+        return object.__getattribute__(self, name)
+                   
+    # Old-style methods that are no longer used
+    def setParamWithToken(self, name, value, token, member): return NotImplemented
+    def getParamWithToken(self, name, token, member): return NotImplemented
+    def getParamListWithToken(self, token, member): return NotImplemented
+    def __add__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __sub__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __mul__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __div__(self, other): raise ValueError, "Model operation are no longer supported"
+
+    
+
+if __name__ == "__main__":
+    b = BaseModel() 
+    print b.operateOn
+    
Index: sansmodels/src/sans/models/NewCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/NewCylinderModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/NewCylinderModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+"""
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/cylinder.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseModel import BaseModel
+from sans_extension.c_models import CCylinderModel
+import copy    
+    
+class CylinderModel(CCylinderModel, BaseModel):
+    """ Class that evaluates a CylinderModel model. 
+    	This file was auto-generated from ../c_extensions/cylinder.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         radius          = 20.0 A
+         length          = 400.0 A
+         contrast        = 3e-006 A-2
+         background      = 0.0 cm-1
+         cyl_theta       = 1.0 rad
+         cyl_phi         = 1.0 rad
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseModel.__init__(self)
+        CCylinderModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "CylinderModel"
+
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['A', None, None]
+        self.details['length'] = ['A', None, None]
+        self.details['contrast'] = ['A-2', None, None]
+        self.details['background'] = ['cm-1', None, None]
+        self.details['cyl_theta'] = ['rad', None, None]
+        self.details['cyl_phi'] = ['rad', None, None]
+
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        obj = CylinderModel()
+        obj.params = copy.deepcopy(self.params)
+        return obj   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CCylinderModel.run(self, x)
+   
+    def runXY(self, x = 0.0):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q, or [qx, qy]
+            @return: scattering function P(q)
+        """
+        
+        return CCylinderModel.runXY(self, x)
+        
+    def set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CCylinderModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
Index: sansmodels/src/sans/models/test/utest_newstylemodels.py
===================================================================
--- sansmodels/src/sans/models/test/utest_newstylemodels.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/test/utest_newstylemodels.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
@@ -0,0 +1,70 @@
+"""
+    Unit tests for dispersion functionality of 
+    C++ model classes
+"""
+
+import unittest, math, numpy
+
+class TestModel(object):
+    """
+        An old-style model
+    """
+    def __init__(self):
+        ## Parameter dictionary
+        self.params = {}
+        self.params['scale']       = 0.05
+        
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale']       = ['',     None, None]
+
+    def run(self, x):
+        return self.params['scale']*x
+
+from BaseModel import BaseModel
+class NewTestModel(BaseModel):
+    scale = ParameterProperty('scale')
+    
+    def __init__(self):  
+        BaseModel.__init__(self)  
+        self.parameters = {}
+        self.parameters['scale'] = Parameter('scale', 4.0) 
+        
+    def run(self, x):
+        return self.scale*x
+        
+
+class TestBaseModel(unittest.TestCase):
+    """
+        Testing C++ Cylinder model
+    """
+    def setUp(self):
+        from sans.models.BaseModel import BaseModel
+        self.model = BaseModel()
+        
+        
+    def test_removed_attrs(self):
+        def setop():
+            print self.model.operateOn
+        self.assertRaises(AttributeError, setop)
+        def setother():
+            print self.model.other
+        self.assertRaises(AttributeError, setother)
+        
+class TestAdaptor(unittest.TestCase):
+    """
+        Testing C++ Cylinder model
+    """
+    def setUp(self):
+        from sans.models.NewCylinderModel import NewCylinderModel
+        self.model = NewCylinderModel()
+        
+        
+    def test_setparam(self):
+        pass
+        
+    
+  
+if __name__ == '__main__':
+    unittest.main()
+   
