J'ai commencé à regarder l'aspect objet de Pn0.8, via le module exampleOBJ des values addon, et même si l'intégration de la technologie est super intéressante, je trouve çà quand même super compliqué.
Je voulais juste savoir si c'était la version final "théorique" qui était dans les addons, ou s'il y avait encore des discussions la dessus.
Si on regarde le POJO de base déjà,
- pourquoi il y a t'il deux fichiers (un pour l'objet de base et un pour les tableaux ?)
- comment on peut rajouter un champs personnalisé. (un attribut à la classe)
- class PNExampleobj1 extends PNObject
- {
- // The constructor only needs to set the fields which are used
- // to configure the object's specific properties and actions.
- // For the most part we can
- function PNExampleobj1($init=null, $key=0)
- {
- // Call base-class constructor
- $this->PNObject();
- // set the tablename this object maps to
- $this->_objType = 'exampleobj_exampleobj1';
- // set the ID field for this object
- $this->_objField = 'id';
- // set the access path under which the object's
- // input data can be retrieved upon input
- $this->_objPath = 'exampleobj1';
- // Call initialization routing
- $this->_init($init, $key);
- }
- // This method is used to tranform data acquired from input
- // in such a way that only 7-bit ASCII characters remain.
- // We only need to provide the actual implementation of
- // this method. It will be invoked automoatically through
- // the framework provided by the PNObject class.
- function getDataFromInputPostProcess ($data=null)
- {
- // initialize transformation parameters
- $special1 = 'ÄÖÜäöüß';
- $special2 = 'AOUaous';
- // in case we don't get any explicit data array assigned
- // we default to the data the object acquired. Typically
- // this data is acquired from the getDataFromInput() method.
- if (!$data)
- $data = &$this->_objData;
- // now perform our transformation
- $data['sortname'] = strtr($data['name'], $special1, $special2);
- // we return the data so that this method can be invoked
- // with explicit parameters and the return this result.
- return $data;
- }
- }
Je sais que ce que je dis peut paraitre utopique, est ce qu'il y aurai pas moyen que les objets métiers de bases soit juste des objets classiques (attributs avec getter et setter) et que les données de mapping soit défini d'une autre manière (exemple : dir dans le dossier classe et génération des tables par derrière).
Bon après, je trouve surement çà super compliqué , parce que je viens de rentrer dedans et que je connais pas encore
Pour ceux qui veulent voir
http://community.postnuke.com/downl...ns_20070521.zip
Merci d'avance




