As already mentioned in Section 3.1, “ Architecture Overview ” any client can access business objects via the logic components only where they are hosted as persistent objects. Before a client can access a business object the client needs to retrieve an operation object which is required as parameter on all following calls from the client to the component or its objects during a transaction. Some client authentication is required by the supplying component since access may be restricted. Access may be granted only for specific remote client IP address. In other cases priviliges have to be assigned to signed-on users of the client to grant access to specific objects or execution of activities on them.
The client can either retrieve the so-called primary object of the component in order to enter the component's object repository, or in case that the client already knows which object is needed an object can be retrieved by its unique entity ID or its unique alias name. Each business object is represented by a proxy object which has only some core information (e.g. the entity ID). The proxy knows which business object it is representing therefore a client having a proxy can retrieve its corresponding business object. This works vice versa from business object to proxy.
Any business object may be linked with another object. A model may specify associations with different multiplicity (in entity relationship models of database design you would say cardinality ). This means that in an assocation with the opposite multiplicity of [0..1] an object of one class can be linked with no or exactly one object of opposite class, e.g. an object of the business class Order may have one linked object of the opposite class Customer. Associations with multiplicity like [0..*] are supported too, e.g. an object of the class Order may be linked to multiple objects of the opposite class OrderItem.
pyswarm automatically provides methods on a given object to retrieve its linked objects. If a collection of objects is given it is possible to browse through all objects in the collection or a sub-set of them based on specific criteria. Ordering is supported. Set theory oriented operations, e.g. union sets, are planned.
For each business object in the repository pyswarm provides core attributes that are available through its proxy representation. Additional business attributes can be specified in the model by defining per attribute a name and a datatype. pyswarm supports rather simple datatypes, e.g. Text or Bool, and composited datatypes are planned, e.g. Currency consisting of a monetary float value and a currency unit.
Business operations have a return-type and (optionally) parameters provided if calling a method on a given business object. Both, return-types and parameters, can be either pyswarm datatypes, custom enumerations or classes specified in the model.
pyswarm supports auto-logic operations which automatically implements methods to create, modify or delete business objects. Alternatively you can write so-called taboo-logic methods for a modeled operation, which are just plain Python-style source code fragments and which are inserted automatically into the appropriate method stub. Inside these method implementations complex business rules may be processed for changing attribute values, adding or removing associated objects, calling other methods, and so on.
pyswarm supports multiple inheritance based on Python's new-style classes. If a business class is not derived from another business class it is automatically sub-classed from the pyswarm specific Entity class.
Business classes can be also sub-classed from one or multiple other business classes in the same component. E.g. the class ExpressOrder could be derived from Order. A sub-class will inherit all attributes, operations and associations specified for its base-class(es).
In some use-cases it makes sense to model a base-class but not to have instances of this base-class in run-time. This is realized by specifying the base-class as abstract . Only non-abstract class can have instances. Singleton classes may will be supported, too.