Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.181.331 Times

Class::Contract 1.00

  Date Added: April 27, 2010  |  Visits: 1.252

Class::Contract

Report Broken Link
Printer Friendly Version


Product Homepage
Download (108 downloads)



Class::Contract - Design-by-Contract OO in Perl. SYNOPSIS package ClassName use Class::Contract; contract { inherits BaseClass; invar { ... }; attr data1; attr data2 => HASH; class attr shared => SCALAR; ctor new; method methodname; pre { ... }; failmsg Error message; post { ... }; failmsg Error message; impl { ... }; method nextmethod; impl { ... }; class method sharedmeth; impl { ... }; # etc. }; Background Design-by-contract is a software engineering technique in which each module of a software system specifies explicitly what input (or data or arguments) it requires, and what output (or information or results) it guarantees to produce in response. These specifications form the "clauses" of a contract between a module and the client software that uses it. If the client software abides by the input requirements, the module guarantees to produce the correct output. Hence by verifying these clauses at each interaction with a module, the overall behaviour of the system can be confidently predicted. Design-by-contract reinforces the benefits of modular design techniques by inserting explicit compile-time or run-time checks on a contract. These checks are most often found in object-oriented languages and are typically implemented as pre-conditions and post-conditions on methods, and invariants on classes. Note that these features differ from simple verification statements such as the C assert statement. Conditions and invariants are properties of a class, and are inherited by derived classes. An additional capacity that is often provided in design-by-contract systems is the ability to selectively disable checking in production code. This allows the contractual testing to be carried out during implementation, without impinging on the performance of the final system. Adding design-by-contract to Perl The Class::Contract module provides a framework for specifying methods and attributes for a class (much like the existing class definition modules Class::Struct, Class::MethodMaker, and Class::Generate). Class::Contract allows both per-object and per-class methods and attributes to be defined. Attributes may be scalar-, array-, hash-, or object-based. Class::Contract differs from other class-specification modules (except Class::Generate) in that it also provides the ability to specify invariant conditions on classes, and pre- and post-conditions on methods and attributes. All of these clauses are fully inheritable, and may be selectively disabled. It differs from all other modules in that it has a cleaner, simpler specification syntax, and -- more importantly -- it enforces encapsulation of object attributes, thereby ensuring that the class contract cannot be subverted. Defining classes Class::Contract provides an explicit syntax for defining the attributes, methods, and constructors of a class. The class itself is defined using the contract subroutine. contract takes a single argument -- a subroutine reference or a block. That block is executed once and the results used to construct and install the various components of the class in the current package: package Queue; contract { # specification of class Queue attributes and methods here };.

Requirements: No special requirements
Platforms: Linux
Keyword: Attributes Class Classcontract Contract Contract Oo Libraries Methods Module Oo Programming Software
Users rating: 0/10

License: Freeware Size: 26.62 KB
USER REVIEWS
More Reviews or Write Review


CLASS::CONTRACT RELATED
Miscellaneous  -  Rebind class properties 1.0
Sometimes you define properties in base class and override the getter setter methods in derived classes. Then you find out the base class though has derived properties are still pointing to baseclasse's methods not the overriden ones.
 
Libraries  -  Class::DBI::Plugin::FilterOnClick 1.0
Class::DBI::Plugin::FilterOnClick is a Perl module to generate browsable and searchable HTML Tables using FilterOnClick in conjunction with Class::DBI. SYNOPSIS # Inside of your sub-class of Class::DBI add these lines: use...
24.58 KB  
Libraries  -  Class::Adapter::Builder 1.02
Class::Adapter::Builder is a Perl module that can generate Class::Adapter classes. SYNOPSIS package My::Adapter; use strict; use Class::Adapter::Builder ISA => Specific::API, METHODS => [ qw{foo bar baz} ], method => different_method;...
24.58 KB  
Libraries  -  DBIx::Class::Schema::Loader::RelBuilder 0.03007
DBIx::Class::Schema::Loader::RelBuilder is a Perl module that builds relationships for DBIx::Class::Schema::Loader. This class builds relationships for DBIx::Class::Schema::Loader. This is module is not (yet) for external use. METHODS new...
32.77 KB  
Libraries  -  Class::MakeMethods::Docs::ToDo 1.01
Class::MakeMethods::Docs::ToDo is a Perl module with ideas, problems, and suggestions. SYNOPSIS There are lots of things that could be done to improve this module. DISTRIBUTION ISSUES Issues about the distribution and supporting files,...
153.6 KB  
Libraries  -  Class::DBI::Template::Stash 0.03
Class::DBI::Template::Stash is a Perl module with Template::Stash subclass for Class::DBI::Template. SYNOPSIS package Music::DBI; use base Class::DBI; use Class::DBI::Template; There is nothing you need to do for this module, it is setup...
10.24 KB  
Libraries  -  Class::Accessor::Fast::Contained 0.05
Class::Accessor::Fast::Contained is a Perl module for fast accessors with data containment. SYNOPSIS package Foo; use base qw(Class::Accessor::Fast::Contained); # The rest is the same as Class::Accessor::Fast This module does two things...
5.12 KB  
Miscellaneous  -  A tidy property idiom 1.4
This script suggests an idiom for property creation that avoids cluttering the class space with get/set/del methods that will not be used directly. Using thel methods idiom to create properties unnecessarily clutters the class space with...
 
Dictionaries  -  MARC Toolkit for Libraries 32
MARC Toolkit for Libraries is a collection of software and sourcecode for working with MARC records. Previously called the MARC Template Library (a C++ template library for MARC records).
241.79 KB  
Miscellaneous  -  Dictionary Mixin / Framework 1.1
This script makes it easy to provide a full dictionary interface to a class defining only a few mapping methods for getting, setting, deleting, and listing keys. Also, a function is provided to incorporate the mixin at runtime so that code for...
 
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB