<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d11473797\x26blogName\x3dDesign+by+Contract\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://aabsdotnet.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://aabsdotnet.blogspot.com/\x26vt\x3d-2923818330935120734', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>
How to design and build a DBC system using C#, and NVelocity.
Previous Posts

Archives

Links
Design by Contract
Thursday, August 04, 2005

DBC in use

I am finally getting around to making use of Aabs.Dbc in my new open source porject Aabs.Norm. I figured that the best proving ground for a thing like this is a thing like that. That is, a highly complex, high performance application framework, that maintains a state in a variety of very complex ways, that uses polymorphism and .NET in sophisticated ways, and that will be adversely affected if the performance of Aabs.Dbc is poor at runtime. Here's an example of the interface to the core object - the Persistence Broker.
namespace Aabs.Norm.Core
{
    public interface IPersistenceBroker
    {
            [Requires("criteria != null")]
        PersistentObject RetrieveObject(Criteria criteria);

            [Requires("persistentObject != null")]
            [Ensures("$before(persistentObject) == 
                $after(persistentObject)")]
            [Ensures("persistentObject.IsPersistent == true")]
            [Ensures("(persistentObject.TimeStamp - DateTime.Now) < 
               new TimeSpan($time_ms)")]
            [Ensures("$result != null")]
            [Ensures("$result.Count == 0")]
        IList SaveObject(PersistentObject persistentObject);

            [Requires("persistentObject != null")]
            [Ensures("$before(persistentObject) == 
              $after(persistentObject)")]
            [Ensures("$result != null")]
            [Ensures("$result.Count == 0")]
            [Ensures("persistentObject.IsPersistent == false")]
        IList DeleteObject(PersistentObject persistentObject);

            [Requires("criteria != null")]
            [Requires("criteria.ForClass != null")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList ProcessCriteria(Criteria criteria);

            [Requires("persistentObject != null")]
            [Ensures("$before(persistentObject) == 
              $after(persistentObject)")]
            [Ensures("$result != null")]
            [Ensures("$result.Name != persistentObject.
                GetType().Name")]
        ClassMap GetClassMapFor(PersistentObject persistentObject);

            [Requires("tableMap != null")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList GetReferrersTo(TableMap tableMap);

            [Requires("persistentObject != null")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList GetLinkedClassMaps(PersistentObject persistentObject);

            [Requires("classMap != null")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList GetLinkedClassMaps(ClassMap classMap);

            [Requires("classMap != null")]
            [Requires("propertyName != null")]
            [Requires("propertyName.Length > 0")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList IncomingConnectionsToAttribute(ClassMap classMap, 
           string propertyName);

            [Requires("procedureName != null")]
            [Requires("procedureName.Length > 0")]
            [Requires("type != null")]
            [Requires("databaseName != null")]
            [Requires("databaseName.Length > 0")]
            [Requires("parameters != null")]
            [Requires("parameters.Count >= 0")]
            [Ensures("$result != null")]
            [Ensures("$result.Count >= 0")]
        IList ProcessStoredProcedure(string procedureName, 
            Type type, string databaseName, 
            NameValueCollection parameters);
            [Requires("procedureName != null")]
            [Requires("procedureName.Length > 0")]
            [Requires("type != null")]
            [Requires("databaseName != null")]
            [Requires("databaseName.Length > 0")]
            [Requires("parameters != null")]
            [Requires("parameters.Count >= 0")]
            [Ensures("$result != null")]
        string ProcessStoredProcedureRaw(string procedureName, 
            Type type, string databaseName, 
            NameValueCollection parameters);

        bool ProcessTransaction();
    }
}


Blogger michelkline4038 said...
I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

http://www.juicyfruiter.blogspot.com  

Blogger lucysmith22798215 said...
Do you want free porn? Contact my AIM SN 'p1nkness' just say 'give me some pics now!'.

No age verification required, totally free! Just send an instant message to AIM screen name "p1nkness".

Any message you send is fine!

AIM abuse can be reported here.  

Blogger joecollins74015892 said...
Get any Desired College Degree, In less then 2 weeks.

Call this number now 24 hours a day 7 days a week (413) 208-3069

Get these Degrees NOW!!!

"BA", "BSc", "MA", "MSc", "MBA", "PHD",

Get everything within 2 weeks.
100% verifiable, this is a real deal

Act now you owe it to your future.

(413) 208-3069 call now 24 hours a day, 7 days a week.  

Blogger kk said...
Multimedia Flash website design dallas ensures maximum penetration with higher acceptance levels. We bring together the best in multimedia technologies so that you stay a creative step ahead of your competition. Flash website design dallas Design Multimedia Presentation, CD Presenataion, Academic Software, Online Educational Software, Web Design and hosting of educational software, Home Schooling Software and Commercial Software.Now our service is in online 24 hour and 7 day's on a week for you please don't forget to bookmark this http://www.flashwebz.com/.  

Post a Comment

Powered for Blogger by Blogger templates