[Modeling-cvs] ProjectModeling/Modeling/doc/UserGuide DefiningaModel.tex,1.28,1.29
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-08-30 14:07:15
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide In directory sc8-pr-cvs1:/tmp/cvs-serv15053/Modeling/doc/UserGuide Modified Files: DefiningaModel.tex Log Message: Documented defaults for BaseRelationship / PyModel Index: DefiningaModel.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide/DefiningaModel.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** DefiningaModel.tex 30 Aug 2003 12:24:24 -0000 1.28 --- DefiningaModel.tex 30 Aug 2003 14:07:11 -0000 1.29 *************** *** 301,305 **** \code{externalName} \code{BOOK}, and \code{RegularCustomer} becomes \code{REGULAR_CUSTOMER}. ! (cf. \function{Modeling.Entity.externalNameForInternalName()}) \item[\code{parentEntity}:] you can choose a parent entity (a *super class*) --- 301,308 ---- \code{externalName} \code{BOOK}, and \code{RegularCustomer} becomes \code{REGULAR_CUSTOMER}. ! (cf. \function{Modeling.Entity.externalNameForInternalName()} and its ! \footnote{as defined in module \module{Entity}, see ! \ulink{documentation} ! {http://modeling.sf.net/API/Modeling-API/public/Modeling.Entity-module.html\#externalNameForInternalName}}) \item[\code{parentEntity}:] you can choose a parent entity (a *super class*) *************** *** 848,852 **** arguments when instanciating a \class{Attribute}. Once set, it should not be changed} ! \lineiv{columnName}{\code{string}}{\code{externalNameForInternalName(name)}}{} \lineiv{type}{\code{string}}{\code{'int'}}{} \lineiv{externalType}{\code{string}}{\code{'INTEGER'}}{} --- 851,856 ---- arguments when instanciating a \class{Attribute}. Once set, it should not be changed} ! \lineiv{columnName}{\code{string}}{\code{externalNameForInternalName(name)} ! \footnote{as defined in module \module{Entity}, see \ulink{externalNameForInternalName}{http://modeling.sf.net/API/Modeling-API/public/Modeling.Entity-module.html\#externalNameForInternalName}}}{} \lineiv{type}{\code{string}}{\code{'int'}}{} \lineiv{externalType}{\code{string}}{\code{'INTEGER'}}{} *************** *** 854,859 **** \lineiv{isRequired}{\code{int}}{\code{0}}{} \lineiv{precision}{\code{int}}{\code{0}}{} - \lineiv{width}{\code{int}}{\code{0}}{} \lineiv{scale}{\code{int}}{\code{0}}{} \lineiv{defaultValue}{~}{\code{None}}{} \lineiv{usedForLocking}{\code{int}}{\code{0}}{} --- 858,863 ---- \lineiv{isRequired}{\code{int}}{\code{0}}{} \lineiv{precision}{\code{int}}{\code{0}}{} \lineiv{scale}{\code{int}}{\code{0}}{} + \lineiv{width}{\code{int}}{\code{0}}{} \lineiv{defaultValue}{~}{\code{None}}{} \lineiv{usedForLocking}{\code{int}}{\code{0}}{} *************** *** 913,916 **** --- 917,923 ---- \end{notice} + Of course, you can redefine the defaults for \class{AFloat} in your PyModel to + fit your needs. + %% \subsubsection{AInteger\label{pymodel-attribute-props-integer}} *************** *** 956,959 **** --- 963,974 ---- to~\ref{attributes-props}. \end{notice} + Of course, you can redefine the defaults for \class{AString} in your PyModel to + fit your needs. For example, if you prefer to use \code{TEXT}, you'll probably + add this to your PyModel: + + \begin{verbatim} + AString.defaults['externalType'] = 'TEXT' + AString.defaults['width'] = 0 + \end{verbatim} %% *************** *** 1001,1051 **** \end{notice} ! %% ! \subsection{Association\label{pymodel-association-props}} ! ! \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} ! \lineiv{multiplicity}{\code{~}}{~}{~} ! \lineiv{relations}{\code{~}}{~}{~} ! \lineiv{keys}{\code{~}}{~}{~} ! \lineiv{delete}{\code{~}}{~}{~} ! \lineiv{isClassProperty}{\code{~}}{~}{~} ! \lineiv{joinSemantic}{\code{~}}{~}{~} ! \lineiv{displayLabel}{\code{~}}{~}{~} ! \lineiv{doc}{\code{~}}{~}{~} ! \end{longtableiv} %% ! \subsection{Relationship\label{pymodel-relationship-props}} \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} ! \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the only ! mandatory arguments when instanciating a \class{APrimaryKey}. Once set, it should not be changed} ! \lineiv{delete}{\code{~}}{~}{~} ! \lineiv{isClassProperty}{\code{~}}{~}{~} ! \lineiv{multiplicity}{\code{~}}{~}{~} ! \lineiv{joinSemantic}{\code{~}}{~}{~} ! \lineiv{src}{\code{~}}{~}{~} ! \lineiv{dst}{\code{~}}{~}{~} ! \lineiv{displayLabel}{\code{~}}{~}{~} ! \lineiv{doc}{\code{~}}{~}{~} ! \lineiv{inverse}{\code{~}}{~}{~} \end{longtableiv} %% \subsubsection{RToOne\label{pymodel-relationship-props-toone}} \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the only ! mandatory arguments when instanciating a \class{APrimaryKey}. Once set, it should not be changed} ! \lineiv{multiplicity}{\code{~}}{~}{~} \lineiv{joinSemantic}{\code{~}}{~}{~} \end{longtableiv} %% \subsubsection{RToMany\label{pymodel-relationship-props-tomany}} \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the only --- 1016,1096 ---- \end{notice} ! If you want to make your foreign keys class properties, please be sure to read ! the dedicated ''FAQ'' entry (\ref{design-faq}). %% ! \subsection{BaseRelationship\label{pymodel-relationship-props}} ! ! A \class{BaseRelationship} describes how two entities relate to each other. ! It has the following attributes: \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} ! \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the first ! mandatory argument when instanciating a \class{BaseRelationship}. Once set, it should not be changed} ! \lineiv{destination}{\code{string}}{\emph{no default}}{The destination ! entity's \code{name} is the second mandatory argument when instanciating a ! \class{BaseRelationship}. Once set, it should not be changed} ! \lineiv{delete}{\code{string}}{\code{'nullify'}}{~} ! \lineiv{isClassProperty}{\code{int}}{1}{~} ! \lineiv{multiplicity}{sequence}{\code{[0,1]}}{~} ! \lineiv{joinSemantic}{\code{int}}{0}{see below} ! \lineiv{src}{\code{string}}{\code{''}}{source attr.'s name} ! \lineiv{dst}{\code{string}}{\code{''}}{destination attr.'s names} ! \lineiv{displayLabel}{\code{string}}{\code{''}}{~} ! \lineiv{doc}{\code{string}}{\code{''}}{~} ! \lineiv{inverse}{\code{string}}{\code{''}}{~} \end{longtableiv} + You'll never need to use a \class{BaseRelationship}; in fact, it's not even + legal in a PyModel. Instead, you'll declare \class{RToOne} + (\ref{pymodel-relationship-props-toone}) and \class{RToMany} + (\ref{pymodel-relationship-props-tomany}) objects; or even better, you'll use + \class{Association} (\ref{pymodel-association-props}) objects to create both a + relationship and its inverse in a single declaration. + + We presented it here because all three element \class{RToOne}, \class{RToMany} + and \class{Association} use the \class{BaseRelationship}'s defaults for their + own defaults (and override some of them). + %% \subsubsection{RToOne\label{pymodel-relationship-props-toone}} + \class{RToOne} objects describe a to-one relationship from an \class{Entity} + to another. It derives from \class{Relationship} and overrides the following + defaults: + \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the only ! mandatory arguments when instanciating a \class{RToOne}. Once set, it should not be changed} ! \lineiv{multiplicity}{sequence}{\code{[0,1]}}{~} \lineiv{joinSemantic}{\code{~}}{~}{~} \end{longtableiv} + (All other defaults are \class{BaseRelationship}'s ones, + cf.\ref{pymodel-relationship-props}) + + Minimally, a \class{RToOne]} needs a \code{name} and a the name of the + destination entity, \code{destination}. + + Attributes \code{src} and \code{dst}, identifying source and destination + attributes, are automatically calculated if they are not supplied: + \begin{itemize} + + \item \code{src} + + \item \code{dst} + + \end{itemize} + %% \subsubsection{RToMany\label{pymodel-relationship-props-tomany}} + \class{RToOne} objects describe a to-many relationship from an \class{Entity} + to another. It derives from \class{Relationship} and overrides the following + defaults: + \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} \lineiv{name}{\code{string}}{\emph{no default}}{The \code{name} is the only *************** *** 1054,1057 **** --- 1099,1129 ---- \lineiv{multiplicity}{\code{}}{}{} \lineiv{joinSemantic}{\code{}}{}{} + \end{longtableiv} + + (All other defaults are \class{BaseRelationship}'s ones, + cf.\ref{pymodel-relationship-props}) + + + %% + \subsection{Association\label{pymodel-association-props}} + + \begin{longtableiv}{p{3cm}p{1.5cm}p{4cm}p{5.5cm}}{code}{Prop.}{Type}{Default}{Comment} + \lineiv{src}{\code{string}}{\emph{no default}}{The source entity's name. This + parameter is mandatory when creating a \class{Association}} + \lineiv{dst}{\code{string}}{\emph{no default}}{The destination entity's + name. This parameter is mandatory when creating a \class{Association}} + \lineiv{multiplicity}{sequence of sequences}{\code{[ [0,1], [0,None] ]}}{} + \lineiv{relations}{sequence of sequences}{~}{~} + \lineiv{keys}{\code{sequence}}{\code{[None, None]}}{~} + \lineiv{delete}{sequence}{\code{[ RToOne.defaults['delete'], + RToMany.defaults['delete'] ]}}{~} + \lineiv{isClassProperty}{sequence}{\code{[ RToOne.defaults['isClassProperty'], + RToMany.defaults['isClassProperty'] ]}}{~} + \lineiv{joinSemantic}{sequence}{\code{[ RToOne.defaults['joinSemantic'], + RToMany.defaults['joinSemantic'] ]}}{~} + \lineiv{displayLabel}{sequence}{\code{[ RToOne.defaults['displayLabel'], + RToMany.defaults['displayLabel'] ]}}{~} + \lineiv{doc}{sequence}{\code{[ RToOne.defaults['doc'], + RToMany.defaults['doc'] ]}}{~} \end{longtableiv} |