Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

metal-dev · MetaL Development

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 190 - 219 of 555   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#190 From: metal-dev@yahoogroups.com
Date: Mon Nov 3, 2003 5:07 am
Subject: New file uploaded to metal-dev
metal-dev@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the metal-dev
group.

   File        : /metastorage/tutorial.html
   Uploaded by : mallemos <mlemos@...>
   Description : Metastorage tutorial document including explanations about
defining validation rules and data object class functions

You can access this file at the URL

http://groups.yahoo.com/group/metal-dev/files/metastorage/tutorial.html

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mallemos <mlemos@...>

#191 From: metal-dev@yahoogroups.com
Date: Mon Nov 17, 2003 7:44 am
Subject: New file uploaded to metal-dev
metal-dev@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the metal-dev
group.

   File        : /metastorage/tutorial.html
   Uploaded by : mallemos <mlemos@...>
   Description :  Metastorage tutorial document including explanations about
defining validation rules and data object class functions, factory and schema
class functions

You can access this file at the URL

http://groups.yahoo.com/group/metal-dev/files/metastorage/tutorial.html

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mallemos <mlemos@...>

#192 From: "Sergio" <storage@...>
Date: Wed Jan 28, 2004 3:25 am
Subject: Acceso a Relaciones N a N
rociser
Send Email Send Email
 
Manuel, te cuento que mi nombre es Sergio Núñez y soy de
Montevideo -
Uruguay y estoy haciendo como proyecto final de carrera junto con unos
compañeros un plugin en eclipse el cual denominamos Visual Storage,
para tu proyecto Metastorage el cual nos pareció muy interesante.

Estoy teniendo problemas al acceder a relaciones N a N es decir

tengo una Empresa la cual tiene sus atributos y Epmpleados los cuales
tienen tambien sus atributos.

Un Empleado puede pertencer a varias empresas y una empresa puede
tener varios empleados.

Yo me imagino acceder de la siguiente forma:

Si entro por empleados, primero elijo un empleado, recupero sus datos,
pero como hago para acceder a las empresas a las que pertence el
empleado???

Sin me podes ayudar te agradezco.

Saludos
Sergio

P/D ya nos queda poco para la entrega final y estamos ajustando los
ultimos detalles, una vez que este todo ok te mandamos el plugin para
que nos des tu opinion.

Lo vamos a liberar con la licencia GNU...

#193 From: Manuel Lemos <mlemos@...>
Date: Wed Jan 28, 2004 9:00 am
Subject: Re: Acceso a Relaciones N a N
mallemos
Send Email Send Email
 
Hello,

Please keep in mind that the official language of this list is English.
So please write in English so every subscriber can understand or mail me
directly.


On 01/28/2004 01:25 AM, Sergio wrote:
> Manuel, te cuento que mi nombre es Sergio Núñez y soy de
> Montevideo -
> Uruguay y estoy haciendo como proyecto final de carrera junto con unos
> compañeros un plugin en eclipse el cual denominamos Visual Storage,
> para tu proyecto Metastorage el cual nos pareció muy interesante.

So, you must be the guys that Diego told me about. That is good to know
that you are developing a Eclipse plugin for Metastorage.



> Estoy teniendo problemas al acceder a relaciones N a N es decir
>
> tengo una Empresa la cual tiene sus atributos y Epmpleados los cuales
> tienen tambien sus atributos.
>
> Un Empleado puede pertencer a varias empresas y una empresa puede
> tener varios empleados.
>
> Yo me imagino acceder de la siguiente forma:
>
> Si entro por empleados, primero elijo un empleado, recupero sus datos,
> pero como hago para acceder a las empresas a las que pertence el
> empleado???

I wanted to have finished the Metastorage tutorial already but I have
been too busy. I think I will able to finish it soon in February.

The part about N-N relationships is already explained in the tutorial.
You may find the latest version available here:

http://groups.yahoo.com/group/metal-dev/files/metastorage/

Anyway, if I got you right, you have companies, employees and you want
to establish a many to many relationship. This is actually very simple.
You just need to define a collection in each class that references each
other.

Here is a simple declaration of the two classes. You probably have also
other attributes in variable and collections but I have not added them here:

<class>

    <name>company</name>

    <collection>
      <name>employees</name>
      <class>employee</class>
      <reference>companies</reference>
    </collection>

</class>

<class>

    <name>employee</name>

    <collection>
      <name>companies</name>
      <class>company</class>
      <reference>employees</reference>
    </collection>

</class>

This reads like this:

- The company class has a collection named employees that are of class
employee.

- The employee class has a collection named companies that are of class
company.

Since the collections are related to each other the reference property
specified the name of the each other collections.


> Sin me podes ayudar te agradezco.

Just let me know if this is enough for you to understand or you need
more explanations. The tutorial above has more detail.


> P/D ya nos queda poco para la entrega final y estamos ajustando los
> ultimos detalles, una vez que este todo ok te mandamos el plugin para
> que nos des tu opinion.

That sounds great! :-)


> Lo vamos a liberar con la licencia GNU...

I am not a big fan of GPL but that is OK as it is your software and you
are the ones that decide what suites your requirements.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

MetaL - XML based meta-programming language
http://www.meta-language.net/

#194 From: Sergio Núñez <storage@...>
Date: Wed Jan 28, 2004 12:53 pm
Subject: Re: Acceso a Relaciones N a N
rociser
Send Email Send Email
 
Manuel Lemos wrote:

> Hello,
>
> Please keep in mind that the official language of this list is English.
> So please write in English so every subscriber can understand or mail me
> directly.

Te pido disculpas pero la verdad es que se me dificulta bastante
escribir y entender Ingles

>
>
> On 01/28/2004 01:25 AM, Sergio wrote:
> > Manuel, te cuento que mi nombre es Sergio Núñez y soy de
> > Montevideo -
> > Uruguay y estoy haciendo como proyecto final de carrera junto con unos
> > compañeros un plugin en eclipse el cual denominamos Visual Storage,
> > para tu proyecto Metastorage el cual nos pareció muy interesante.
>
> So, you must be the guys that Diego told me about. That is good to know
> that you are developing a Eclipse plugin for Metastorage.

Si, asi es somos nosotros.

>
>
>
> > Estoy teniendo problemas al acceder a relaciones N a N es decir
> >
> > tengo una Empresa la cual tiene sus atributos y Epmpleados los cuales
> > tienen tambien sus atributos.
> >
> > Un Empleado puede pertencer a varias empresas y una empresa puede
> > tener varios empleados.
> >
> > Yo me imagino acceder de la siguiente forma:
> >
> > Si entro por empleados, primero elijo un empleado, recupero sus datos,
> > pero como hago para acceder a las empresas a las que pertence el
> > empleado???
>
> I wanted to have finished the Metastorage tutorial already but I have
> been too busy. I think I will able to finish it soon in February.

El problema es que tenemos que tener finalizada la codificacion para
este fin de semana (el 10 de febrero tenemos que entregar con
documentacion incluida)

>
> The part about N-N relationships is already explained in the tutorial.
> You may find the latest version available here:
>
> http://groups.yahoo.com/group/metal-dev/files/metastorage/

Ok.. voy a mirarlo...

>
> Anyway, if I got you right, you have companies, employees and you want
> to establish a many to many relationship. This is actually very simple.
> You just need to define a collection in each class that references each
> other.
>
> Here is a simple declaration of the two classes. You probably have also
> other attributes in variable and collections but I have not added them
> here:
>
> <class>
>
>    <name>company</name>
>
>    <collection>
>      <name>employees</name>
>      <class>employee</class>
>      <reference>companies</reference>
>    </collection>
>
> </class>
>
> <class>
>
>    <name>employee</name>
>
>    <collection>
>      <name>companies</name>
>      <class>company</class>
>      <reference>employees</reference>
>    </collection>
>
> </class>

Esto ya lo pudimos hacer mirando tu ejemplo, lapregunta viene por el
lado de como hago para recuperar todas las companias a las que pertenece
el empleado

si no entendi mal tu creas una Tabla relacion que la llamas del modo
company_employees_employee_companies, yo podria recuperar esta relacion
directamente de la tabla pero me parece mas prolijo y supongo que es la
forma mas correcta que yo recupere en memoria un empleado y este me de
las empresas a las que pertence.

Ademas se me complica para recuperar la relacion pues como me doy cuenta
del nombre de la tabla si se puede llamar de dos maneras diferentes,
company_employees_employee_companies o
employee_companies_company_employees....

Otra duda que me surgio es en las relaciones N a 1, es el miemo ejemplo
pero un empleado puede pertenecer a una sola empresa, por lo cual la
forma en que resolvi el acceso fue de la siguiente manera:

Cuando quiero dar de alta a un empleado,

recupero la lista de todas las empresas a las que pertenece,
$AllCompanies = $component->getAllCompanies();

una vez hecho e ingresados los datos del empleado recibo el Id de la
empresa seleccionada,
intente recuperar la empresa

$CompanieObj = $component->getCompanie($IdCompany);

y luego se la setee al empleado
$EmployeeObj->company = $CompanyObj

para luego utilizar el metodo persist,
$EmployeeObj->persistEmployee();
pero no me funciono

por lo que le asigne al objeto empleado en el atributo empresa el Id de
empresa

$EmpladoObj->empresa = $Id

y luego llame al metodo Persist de empleado
$EmployeeObj->persistEmployee();
y ahi si me guardo todo en la tabla sin problema,

esta ultima es la forma en que tu planeaste que se guardara, o hay que
tener un metodo setCompany($CompanyObj) en empleado para que cuando
utilice el persist, el miemo guarde a las company???


La forma en escribir el component creo que no estoy teniendo muchos
problemas mis problemas vienen mas en que metodos utilizar para hacer
determinadas acciones.

Gracias por tu pronta respuesta y espero que no te estemos complicando.

Saludos
Sergio


ADSL    -    Para estar las 24 horas en internet
http://www.internet.com.uy       Tel. 707.42.52

#195 From: Manuel Lemos <mlemos@...>
Date: Thu Jan 29, 2004 5:52 am
Subject: Re: Acceso a Relaciones N a N
mallemos
Send Email Send Email
 
Hello,

On 01/28/2004 10:53 AM, Sergio Núñez wrote:
>>Please keep in mind that the official language of this list is English.
>>So please write in English so every subscriber can understand or mail me
>>directly.
>
>
> Te pido disculpas pero la verdad es que se me dificulta bastante
> escribir y entender Ingles

Ok, I will reply privately to this message as most people here would not
understand spanish.


--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

MetaL - XML based meta-programming language
http://www.meta-language.net/

#196 From: metal-dev@yahoogroups.com
Date: Wed Mar 10, 2004 7:07 am
Subject: New file uploaded to metal-dev
metal-dev@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the metal-dev
group.

   File        : /metastorage/tutorial.html
   Uploaded by : mallemos <mlemos@...>
   Description : Metastorage tutorial document including explanations about
defining validation rules and data object class functions, factory schema class
functions, and using the generated code

You can access this file at the URL

http://groups.yahoo.com/group/metal-dev/files/metastorage/tutorial.html

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mallemos <mlemos@...>

#197 From: metal-dev@yahoogroups.com
Date: Tue Mar 16, 2004 6:29 am
Subject: New file uploaded to metal-dev
metal-dev@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the metal-dev
group.

   File        : /metastorage/tutorial.html
   Uploaded by : mallemos <mlemos@...>
   Description : Complete Metastorage tutorial with step by step instructions on
installing Metastorage, designing components, generating component code and
using the generated code

You can access this file at the URL

http://groups.yahoo.com/group/metal-dev/files/metastorage/tutorial.html

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mallemos <mlemos@...>

#198 From: Manuel Lemos <mlemos@...>
Date: Tue Mar 16, 2004 6:40 am
Subject: Metastorage tutorial complete
mallemos
Send Email Send Email
 
Hello,

As you may have read in the previous notification message, finally I
ended the Metastorage tutorial.

For now, it includes sections on installing Metastorage, designing
components, generating component code and using the generated code in
your applications.

Only two sections were postponed for a later opportunity that I get to
finish this: designing and  using form handling classes and generating
UML class diagrams.

I will still make a few adjustments to make the tutorial and the
reference manual documents be split in several HTML files, one per each
section, as now it looks too long and may scare people. ;-)

I would appreciate your feedback on whether this tutorial is clear and
useful enough to get you started on writing applications with Metastorage.


Next Metastorage development steps include completing the set of
expressions supported by the object query language and document it so
people can use it in functions that query persisted objects.


Meanwhile, keep that feedback coming.



--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#199 From: Manuel Lemos <mlemos@...>
Date: Tue Mar 23, 2004 2:19 am
Subject: ANN: Released extensive Metastorage documentation
mallemos
Send Email Send Email
 
Hello,

New and improved Metastorage documentation materials were released with
the intention of helping developers to get started with this software
development productivity tool and quickly deploy their PHP applications.

Besides the Metastorage reference manual that already existed and was
improved for this release, there is now a tutorial and an how-to
document to address different levels of interest from the developers on
Metastorage documentation.

http://www.meta-language.net/news-2004-03-20-metastorage.html

http://www.meta-language.net/screenshots.html

What is Metastorage?

Metastorage is an application that is meant to automatically generate
code from an high level data model definition.

Metastorage is a tool meant to provide an efficient method of
development of medium or large size applications that store and retrieve
data from SQL based databases or other types of persistence storage
containers, like XML files, flat file databases or in LDAP servers.

What does Metastorage generate?

Metastorage generates data object access classes. Currently it generates
code in PHP. The data objects are stored in SQL based relational
databases. In the future, other languages and storage containers will be
supported.

http://www.meta-language.net/metastorage-faq.html



--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#200 From: "Josh" <josh@...>
Date: Wed Mar 24, 2004 5:19 am
Subject: Error: listtargetfiles is not a supported build object attribute
jtnye79
Send Email Send Email
 
I just downloaded metal.zip and metabase.zip from the site and when I
run 'metastorage cms.component' I get the following:

Error: listtargetfiles is not a supported build object attribute (File
"build.input", Line 20, Column 150, Byte 382)

What's that mean? How can I get this working?

Thanks,
--josh

#201 From: Manuel Lemos <mlemos@...>
Date: Wed Mar 24, 2004 6:12 am
Subject: Re: Error: listtargetfiles is not a supported build object attribute
mallemos
Send Email Send Email
 
Hello,

On 03/24/2004 02:19 AM, Josh wrote:
> I just downloaded metal.zip and metabase.zip from the site and when I
> run 'metastorage cms.component' I get the following:
>
> Error: listtargetfiles is not a supported build object attribute (File
> "build.input", Line 20, Column 150, Byte 382)
>
> What's that mean? How can I get this working?

That looks like the archives where not correctly installed. Lets
recapture the installation procedure to verify if everything was done
correctly. Under Windows replace where / appears by \ .

- Extract metal.zip in somedirectory/
- Extracted metastorage.zip in somedirectory/metal/
- Changed current directory to somedirectory/metal/metastorage/
- Executed php -q metastorage cms.component

If you did all this and it still gave you that error, just let me know
which PHP version and OS you are using so I can try to reproduce the
problem.

Feel free to mail me privately to let me know the instant messenger
account that you use (ICQ, AOL, MSN, Yahoo, Jabber, etc..) so I can
contact you soon and help you interactively soon.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#202 From: "Josh" <josh@...>
Date: Wed Mar 24, 2004 1:10 pm
Subject: Re: Error: listtargetfiles is not a supported build object attribute
jtnye79
Send Email Send Email
 
Hello Manuel,

This was with PHP 5.0 RC1 on RedHat 7.3. This morning I tried the same
with PHP 4.2.x and it worked just fine. I guess PHP 5 support needs to
be added?

Thanks,
--josh

> >
> > Error: listtargetfiles is not a supported build object attribute
(File
> > "build.input", Line 20, Column 150, Byte 382)
>
> If you did all this and it still gave you that error, just let me
know
> which PHP version and OS you are using so I can try to reproduce
the
> problem.
>

#203 From: Manuel Lemos <mlemos@...>
Date: Wed Mar 24, 2004 9:39 pm
Subject: Re: Re: Error: listtargetfiles is not a supported build object attribute
mallemos
Send Email Send Email
 
Hello,

On 03/24/2004 10:10 AM, Josh wrote:
> This was with PHP 5.0 RC1 on RedHat 7.3. This morning I tried the same
> with PHP 4.2.x and it worked just fine. I guess PHP 5 support needs to
> be added?

Ah, yes, PHP 5 is not recommended because it is still in beta testing.

I tried the latest RC and it misbehaves badly. I even have tried using
the option zend.ze1_compatibility_mode=On and it still misbehaves. So,
it is not that Metastorage/Metal are not compatible with PHP 5 but
rather that PHP 5 is not compatible with PHP 4.

Anyway, I will be looking on this further to either add possible
workarounds or report any PHP 5 bugs that I may find. If possible I hope
release a PHP 5 compliant version next week.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#204 From: "enradia" <enradia@...>
Date: Sun Apr 25, 2004 2:27 am
Subject: Filter status and other questions on metastorage
enradia
Send Email Send Email
 
Hi Manuel

My name is Joshua and I am the project leader for Nexista
(nexista.tigris.org). We are currently using metabase for our DB
access and have decided to move to a DAO approach. We are
considering Metastorage or Propel.  SO far I am very impressed with
what I have seen and have a couple of questions.

1. I understand that filters is under development. What is the ETA
for a usable set and what will it look like. For example, the Propel
approach towards WHERE filters might look like:

$c->add(AuthorPeer::FIRST_NAME, "Karl");
$c->add(AuthorPeer::LAST_NAME, "Marx", Criteria::NOT_EQUAL);

Pear is similar. Neither is much easier than writing raw sql though
it may be more portable.

What would be a Metastorage example of something like this? a
complicated example would be great :)


2. Nexista already has it's own validator/filter/form system (all
xml). It would be nice to extend Metastorage to generate generic
filter/validator/form files.  Would this be a difficult task? I took
a looksy at the .input and .ouput files. I assume these are the
Metal configs that generate the whole thing?

I'm not sure if you have looked at Propel. I know from past emails
that you've given very useful and professional comparisons of
Metabase vs xxx. I would be curious to hear of your thoughts on
this.

I can be reached at js AT nexista DOT com as well.

Thanks in advance for your time
Joshua Savage

#205 From: Manuel Lemos <mlemos@...>
Date: Wed Apr 28, 2004 3:45 am
Subject: Re: Fwd: Filter status and other questions on metastorage
mallemos
Send Email Send Email
 
Hello,

--- In metal-dev@yahoogroups.com, "enradia" <enradia@y...> wrote:
> My name is Joshua and I am the project leader for Nexista
> (nexista.tigris.org). We are currently using metabase for our DB
> access and have decided to move to a DAO approach. We are
> considering Metastorage or Propel.  SO far I am very impressed with
> what I have seen and have a couple of questions.

Yes, currently Metastorage generates code that still uses Metabase but I
plan to make it an option between Metabase and using code that uses
native PHP database API calls. I am thinking about generating MySQL
specific code in a first alternative implementation.

Generating PHP 5 specific code as an option is also planned and will not
take much work as most of the new PHP 5 features were already supported
in MetaL classes object model (protected, private, public, package,
exceptions, etc...).

BTW, recently I made a suggestion to Zend people to add a warning when
object cloning is performed in Zend engine 1 compatibility mode but will
no longer happen in PHP 5 with Zend engine 2. This has already helped
locating some inadverted object copying occurrences in MetaL engine code
and soon I will be fixing them. This means that all MetaL applications
will run under PHP 5 soon too. The code generated by Metastorage is not
a problem because it is already passing objects by reference everywhere.


> 1. I understand that filters is under development. What is the ETA

The filters are done since a long time ago. This means that the logic
for translating filter expressions to SQL syntax is ready. What is not
done is the support to most of the types of expressions and operators
that you will want to use, although that is the easy part.

I intend to work on finishing and document that soon next month. For now
you can for instance just add a getallobjects functions with filter like
this and it will generate the appropriate code.

<function>
    <name>getrootcategories</name>
    <type>getallobjects</type>
    <parameters>
      <class>category</class>
      <filter>
        <isnull><variable>parent</variable></isnull>
      </filter>
    </parameters>
</function>


As for an estimated time for availability, usually I implement features
once I can test them in real usage situation because that way I can test
and validate the implementation. That is why only a part of the filter
expressions was implemented. That was what I needed when I developed it.

I intend to finish a basic set a common filter expressions and operators
soon because I really need that for other projects. Soon in this case
means the first two weeks of May as that it will be when I will be done
with the pending issues of the Innovation Award of the PHP Classes site.



> for a usable set and what will it look like. For example, the Propel
> approach towards WHERE filters might look like:
>
> $c->add(AuthorPeer::FIRST_NAME, "Karl");
> $c->add(AuthorPeer::LAST_NAME, "Marx", Criteria::NOT_EQUAL);
>
> Pear is similar. Neither is much easier than writing raw sql though
> it may be more portable.
>
> What would be a Metastorage example of something like this? a
> complicated example would be great :)

If you pick the example getallobjects function filter above you may be
able to see what is generated.

Anyway, the basic principle is that you will never have to build the
search query dynamically at run time and even less you will need to
enter SQL by hand. Remember that Metastorage is meant to generate
storage container independent API. Most storage containers do not even
provide SQL, like flat files databases, XML files, data in LDAP servers,
etc..

The way it works, is that when you need to perform a search with a given
filter expression, you need to add a query factory function of type like
getobject or getallobjects if you do not depart from an existing object
or some other class function if you depart from an existing object.

Lets consider you example above of wanting to retrieve all objects of
class author with first name Karl and last name not Marx. You would need
to declare a factory function of type getallobjects like this:

<function>
   <name>getkarlnotmarx</name>
   <type>getallobjects</type>
   <parameters>
    <class>author</class>
    <filter>
      <variable>first_name</variable> <equalto /> <text>Karl</text>
     <and />
      <variable>last_name</variable> <differentfrom /> <text>Marx</text>
    </filter>
   </parameters>
</function>

But lets say you do not want to make those literal strings static and
take them as arguments that you can pass at run time. You just need to
add arguments to the function and use them in the filter expression.

<function>
   <name>getkarlnotmarx</name>
   <type>getallobjects</type>
   <parameters>
    <class>author</class>
    <argument>
     <name>first_name</name>
     <type>TEXT</type>
    </argument>
    <argument>
     <name>last_name</name>
     <type>TEXT</type>
    </argument>
    <filter>
      <variable>first_name</variable> <equalto />
<argument>first_name</argument>
     <and />
      <variable>last_name</variable> <differentfrom />
<argument>first_name</argument>
    </filter>
   </parameters>
</function>

More complex cases involve relationships (joins) that require also the
declaration of the classes of the objects involved in the relationships
that you want to query.


> 2. Nexista already has it's own validator/filter/form system (all
> xml). It would be nice to extend Metastorage to generate generic
> filter/validator/form files.  Would this be a difficult task? I took
> a looksy at the .input and .ouput files. I assume these are the
> Metal configs that generate the whole thing?

It is not difficult but there is a lot to explain because the way MetaL
works is unusual. You do not program it MetaL, you just write programs
that once compiled do what you want in a target language. That is
meta-programming.

  From the base MetaL meta-programming language to PHP/Java/Perl it is
more or less simple to understand because it is a basic translation
performed by different modules of MetaL compiler that take care of
implementing things like control flow, expression handling, classes,
templates compilation, etc...

Metastorage is actually a wrapper around a special module named
persistence. The persistence module does not generate (now) code in a
target language directly. Instead it generates MetaL code (XML, those
input, output, class files in the generated directory) that other
modules will process in a second stage to the generate the target
language code (currently just PHP).

You can call that meta-meta-programming or meta-2-programming. The trend
is to abstract your applications higher and have other smarter modules
that wrap around the persistence module to provide very high level
domain specific programming support. But this is already an advanced
topic that moves away from what you need to know now.

The persistence module generates an output stream that defines XML
documents that compose those files in the generated directory. Currently
such composition is done with a lot of PHP code in
metal_persistence_*.php classes.

I am not happy with this solution because it is hard to maintain. So, I
plan to soon add support to generate all from XML templates that will be
easier to maintain. I think then it will be easier for you to understand
   and customize.

For now, MetaL generates data object classes and also basic form classes
to handle simple classes but nothing stops you for now to generate your
own form classes that call the data object classes generated by MetaL.
That is what currently the form classes generated by MetaL do.


> I'm not sure if you have looked at Propel. I know from past emails
> that you've given very useful and professional comparisons of
> Metabase vs xxx. I would be curious to hear of your thoughts on
> this.

I do not know all that those packages can do. But from what I could
gather what they do still works a lot based on executing static
decisions dynamically, thus loosing the chance to optimize the generate
code as much as it could.

The example of composing search queries above demonstrates that clearly.
When you develop your applications, you will hardly ever need to compose
search queries dynamically. Most of your queries have static formats,
despite they may depend on run-time parameters as in the case when you
pass query parameters as function arguments.

All this dynamic composion approach has a price in terms of performance
and code bloat.

Another problem is that these packages tend to make it all depend on fat
base classes that ship all the functionality that you could ever need,
whether or not you will really use it in your applications.

In PHP this is particularly penalizing. PHP objects are in fact
associative arrays accessed with a different syntax. So, all those
functions and variable will occupy space and take some initialization
time even if you do not use them.

The Metastorage approach is what I call JE WIN - Just Exactly What I
Need. It means that in practice, the persistence module will only
generate the code that each class model needs, not more, not less.

For instance, if you do not need a function to delete an object,
Metastorage will not generate it. That is why Metastorage requires that
you declare that you need in each class apart from those that are
mandatory because you will always use them.

Anyway, as I said I do not know enough about those other solutions. If
you have studied them and found any details where their approach is
beneficial, I would certainly would like to know because it may have
been some optimization opportunity that I may have overlooked.

This is part of the reason why it pays to open the source of projects.
Have poeple with critical eyes look into it and suggest things that
could be done better.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#206 From: "pokara93" <loto@...>
Date: Fri Apr 30, 2004 2:58 pm
Subject: removefromcollection
pokara93
Send Email Send Email
 
hello, i try to using metastorage but i have a problem to the type
function removefromcolleciton:
"Error: removefromcollection is not a supported function type".
i define a class called Permiso and it's have a collection of the
class "usuario" and inside the class "usuario" it's have a collection
of the class "permiso". Permiso is'nt a persist class, but i can
removefromcollection of usuario one permiso.
  can anybody help me? thanks

#207 From: "pokara93" <loto@...>
Date: Fri Apr 30, 2004 3:11 pm
Subject: Re: Acceso a Relaciones N a N
pokara93
Send Email Send Email
 
hola, también estoy interesada en cual fue la respuesta que te dio
Manuel para tu pregunta. Mi problema es practicamente igual, tengo
empresas y empleados asi que me gustaría saber cómo va todo.
Sobretodo lo que no me funciona es el tema de borra un usuario de la
colección de usuarios de una empresa.
te agradeceria mucho la ayuda.

#208 From: Manuel Lemos <mlemos@...>
Date: Sun May 2, 2004 8:19 am
Subject: Re: removefromcollection
mallemos
Send Email Send Email
 
Hello,

On 05/02/2004 05:05 AM, mallemos wrote:
> --- In metal-dev@yahoogroups.com, "pokara93" <loto@m...> wrote:
>  hello, i try to using metastorage but i have a problem to the type
> function removefromcolleciton:
> "Error: removefromcollection is not a supported function type".
> i define a class called Permiso and it's have a collection of the
> class "usuario" and inside the class "usuario" it's have a collection
> of the class "permiso". Permiso is'nt a persist class, but i can
> removefromcollection of usuario one permiso.

removefromcollection function was added in the last release of
Metastorage. Are you sure that you are using the latest release of
Metastorage and MetaL archives that are in the download page of the
MetaL site? (check the file metal/metal/metal_persistence.php and see
the version in the header is 1.87).

If it is, I will need sample of your component to test it myself and see
what is the matter.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#209 From: "pokara93" <loto@...>
Date: Tue May 11, 2004 11:26 am
Subject: getvariables of a class
pokara93
Send Email Send Email
 
sorry i see the error before write the message. And thank's for your
answer.

my next question is if is possible to implement a gets function from
mestastorage. Not a getreference or getobject, just a get variable
ex:

<class>
<name>empresa</name>

  <variable>
    <name>nombre</name>
    <type>text</type>
  </variable>

  <function>
    <name>getNombre</name>
    <type>???????????????</type>
  </function>

is this possible???
thank's

#210 From: Manuel Lemos <mlemos@...>
Date: Wed May 12, 2004 2:13 am
Subject: Released PHP 5 compliant MetaL engine
mallemos
Send Email Send Email
 
A new revision of the MetaL engine that is compliant with PHP 5 was
released. Several classes that compose the different modules of the
MetaL compiler engine were fixed to make object cloning work under PHP 5
in parts of the code where object copying was intentional.

These fixes are important because they make all MetaL engine
applications ready for use with PHP 5. These applications include
Metastorage, a Data Access Object (DAO) classes generator tool.

Full news article
http://www.meta-language.net/news-2004-05-11-metal.html

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#211 From: Manuel Lemos <mlemos@...>
Date: Wed May 12, 2004 2:30 am
Subject: Re: getvariables of a class
mallemos
Send Email Send Email
 
Hello,

On 05/11/2004 08:26 AM, pokara93 wrote:
> sorry i see the error before write the message. And thank's for your
> answer.
>
> my next question is if is possible to implement a gets function from
> mestastorage. Not a getreference or getobject, just a get variable
> ex:
>
> <class>
> <name>empresa</name>
>
>  <variable>
>    <name>nombre</name>
>    <type>text</type>
>  </variable>
>
>  <function>
>    <name>getNombre</name>
>    <type>???????????????</type>
>  </function>
>
> is this possible???

getters and setters functions are on my todo list as a code generation
option. There will be separate configuration file that you will be able
to use to define details about the generated code like whether you want
to generate getters and setters functions and rules to format function
names.

Right now I am working on enabling the filters parameters that will
allow the customization of functions that retrieve objects using search
parameters. I will work on getters and setters after that. Meanwhile,
please be patient.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#212 From: "dooctor2000" <nospam_st@...>
Date: Tue May 18, 2004 9:52 pm
Subject: Newbie How To Questions
dooctor2000
Send Email Send Email
 
Hello,

I discovered metastorage two days ago and I am really EXCITED about
it. The idea simply rocks!

I'm now trying redesign the backend classes of my current PHP
webshop by using metastorage. I managed to create classes including
crossreferences. But it looks like metastorage is still missing some
features I'd need to express all required constraints and relations.

Therefore in this post my current 3 how-to questions and I hope you
forgive me for the case they are trivial and already explained
thousand times:
1. How to define "created" and "modified" datetime fields that
update automatically when persisting an object?
2. how to retrieve an object's oid?
3. How to setup a filter that returns all objects of a collection
that have a certain property set to false?

Thanks in advance!

Regards,
Sebastian

#213 From: "dooctor2000" <nospam_st@...>
Date: Tue May 18, 2004 10:12 pm
Subject: Suggestions
dooctor2000
Send Email Send Email
 
Hi,
after sending my 3 how to questions I'd like to suggest some
improvements to metastorage and would ask your opinion .... maybe
some of them are already realized but I oversaw them. I orded them
by my own priorities. Priority 1 improvments are currently a show
stopper for me. If they could be solved I can transfer my current
webshops data model to metastorage.

Prio 1
- Error: "decimal" is not a supported database data type => tutorial
says so
- add notnull validation rule for objects to enforce a 1-1 relation
instead of a 1-0

Prio 2
- cascade deletion and persisting of referenced objects add
parameter to collection/object reference called cascade-
delete/cascade-persist
- allow compilation of components located in other directories
   for this you probably need to change require statements like this:
        require('../xmlparser/xml_parser.php');
   to
        require(__FILE__.'/../../xmlparser/xml_parser.php');
   This ensures that it is relative to the current executed php script

- you must at least define one class in the component file otherwise
it fails. even if you use include class
- specifying default values for scalar types (integer, boolean,
string)
- support for class inheritance, this will save a lot of xml writing
- please provide more searchFilterExamples
- please explain the <parameters> <class> <id> and <argument> tags
in a function definition like:
   <function>
     <name>getCategory</name>
     <type>getobject</type>
     <parameters>
       <class>category</class>
       <id>
          <argument>category</argument>
       </id>
     </parameters>
   </function>

Prio 3
- to avoid name conflicts in PHP optionally allow to specify a
package name that is automatically prepended to the name of
generated data classes, e.g myShop_Categoryclass
- how about renaming <function> to <method> and <variable> to
<property> these are more OOP like terms?
- how about renaming <validate> to <constraint>?
- optionally use PHP5 private, protected and public for class
properties and methods

I'm looking forward to your feedback.

Thanks again,
Sebastian

#214 From: Manuel Lemos <mlemos@...>
Date: Tue May 18, 2004 10:47 pm
Subject: Re: Newbie How To Questions
mallemos
Send Email Send Email
 
Hello,

On 05/18/2004 06:52 PM, dooctor2000 wrote:
> 1. How to define "created" and "modified" datetime fields that
> update automatically when persisting an object?

Currently there is no support for automatically assigned values. It
seems not to be a great deal though. So, I can implement this soon if it
is really important. Meanwhile, you define such variables and assign
them in your scripts before persisting your objects.


> 2. how to retrieve an object's oid?

Currently, it is the id automatic variable of all class objects.


> 3. How to setup a filter that returns all objects of a collection
> that have a certain property set to false?

Filters are already implemented in the current version in the CVS
repository. I am working on the documentation before it is officially
released.

Basically you need to declare a factory function of type getallobjects
like this:

<function>
    <name>getUnpublishedArticles</name>
    <type>getallobjects</type>
    <parameters>
      <class>article</class>
      <filter>
          <variable><name>published</name></variable>
        <equalto />
          <boolean>0</boolean>
       </filter>
    </parameters>
</function>

If you want to make the published condition be specified by a value
defined at runtime, you can use a function argument like this:

<function>
    <name>getPublishedArticles</name>
    <type>getallobjects</type>
    <argument>
      <name>published</name>
      <type>boolean</type>
    </argument>
    <parameters>
      <class>article</class>
      <filter>
          <variable><name>published</name></variable>
        <equalto />
          <argument>published</argument>
       </filter>
    </parameters>
</function>

This is also support for complex filter rules that envolve related
objects (joins with other tables in SQL speak including self-joins if
necessary).


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#215 From: "dooctor2000" <nospam_st@...>
Date: Tue May 18, 2004 11:14 pm
Subject: Re: Newbie How To Questions
dooctor2000
Send Email Send Email
 
Thanks for answering my questions so quickly. That really helped me.
If it is just a quick fix I'd really like to see the a default value
tag. I'm mainly interested in having this feature for boolean values.

Cheers,
Sebastian

--- In metal-dev@yahoogroups.com, Manuel Lemos <mlemos@p...> wrote:
> Hello,
>
> On 05/18/2004 06:52 PM, dooctor2000 wrote:
> > 1. How to define "created" and "modified" datetime fields that
> > update automatically when persisting an object?
>
> Currently there is no support for automatically assigned values.
It
> seems not to be a great deal though. So, I can implement this soon
if it
> is really important. Meanwhile, you define such variables and
assign
> them in your scripts before persisting your objects.
>
>
> > 2. how to retrieve an object's oid?
>
> Currently, it is the id automatic variable of all class objects.
>
>
> > 3. How to setup a filter that returns all objects of a
collection
> > that have a certain property set to false?
>
> Filters are already implemented in the current version in the CVS
> repository. I am working on the documentation before it is
officially
> released.
>
> Basically you need to declare a factory function of type
getallobjects
> like this:
>
> <function>
>    <name>getUnpublishedArticles</name>
>    <type>getallobjects</type>
>    <parameters>
>      <class>article</class>
>      <filter>
>          <variable><name>published</name></variable>
>        <equalto />
>          <boolean>0</boolean>
>       </filter>
>    </parameters>
> </function>
>
> If you want to make the published condition be specified by a
value
> defined at runtime, you can use a function argument like this:
>
> <function>
>    <name>getPublishedArticles</name>
>    <type>getallobjects</type>
>    <argument>
>      <name>published</name>
>      <type>boolean</type>
>    </argument>
>    <parameters>
>      <class>article</class>
>      <filter>
>          <variable><name>published</name></variable>
>        <equalto />
>          <argument>published</argument>
>       </filter>
>    </parameters>
> </function>
>
> This is also support for complex filter rules that envolve related
> objects (joins with other tables in SQL speak including self-joins
if
> necessary).
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html

#216 From: "dooctor2000" <nospam_st@...>
Date: Tue May 18, 2004 11:30 pm
Subject: "Collection Variable Is Empty" Filter?
dooctor2000
Send Email Send Email
 
Hi,
I found this example in the newsgroup:
<function>
<name>getrootcategories</name>
<type>getallobjects</type>
<parameters>
<class>category</class>
<filter>
<isnull><variable>parent</variable></isnull>
</filter>
</parameters>
</function>

what do I have to write if the category can have multiple parent
categories (m-n relation) and I want all categories that doesn't
have a single parentCategory. isnull will propably not work or am I
wrong?

Sebastian

#217 From: Manuel Lemos <mlemos@...>
Date: Wed May 19, 2004 4:24 am
Subject: Re: Suggestions
mallemos
Send Email Send Email
 
Hello,

On 05/18/2004 07:12 PM, dooctor2000 wrote:
> Hi,
> after sending my 3 how to questions I'd like to suggest some
> improvements to metastorage and would ask your opinion .... maybe
> some of them are already realized but I oversaw them. I orded them
> by my own priorities. Priority 1 improvments are currently a show
> stopper for me. If they could be solved I can transfer my current
> webshops data model to metastorage.
>
> Prio 1
> - Error: "decimal" is not a supported database data type => tutorial
> says so

This has two parts. One was about a bug due to missing case in a switch
that it was just fixed. The other part is about missing support to other
types than text in the forms generation support. This can be done
although it is not that simple. OTOH, maybe you do not need this.



> - add notnull validation rule for objects to enforce a 1-1 relation
> instead of a 1-0

This can be added without much effort. Actually the the notempty already
does this for text variables. Probably documenting this will take more
time but even that is not a big deal. Anyway, it can be done for the
next release.


> Prio 2
> - cascade deletion and persisting of referenced objects add
> parameter to collection/object reference called cascade-
> delete/cascade-persist

This is feasible but not simple mainly because of special cases that
need to be taken care conviniently.

Cascaded deletion or persisting can be done directly on the database. If
it takes multiple queries, implicit transactions are need. That is no
problem but some databases do not support them.

However, cascaded deletion done only on the database may not be enough.
If the objects being deleted are also in memory, I need to figure which
are those object to destroy them, which can also be a big problem.

In PHP you really cannot destroy objects in memory, just unset all
variables referencing them. The objects are really destroyed when all
references are removed. This may lead to inconsistency problems that I
do not have a good idea of how to handle.

Cascaded persisting requires support to setter functions to be done
efficiently. Without setters, the classes will not know which objects in
memory where changed and need to be persisted. I could just persist all
possibly changed objects but that would lead to eventual persisting of
some objects that were not changed. Even with setters it maybe tricky to
figure how to do it efficiently.

All this to say that it can be done but needs careful thought on how to
do it right. Setter and getter functions support is planned for next
release but implementing that is the easy part of the problem.

> - allow compilation of components located in other directories
>   for this you probably need to change require statements like this:
>        require('../xmlparser/xml_parser.php');
>   to
>        require(__FILE__.'/../../xmlparser/xml_parser.php');
>   This ensures that it is relative to the current executed php script

Oh, yes, I plan to fix this soon because it is a silly limitation.


> - you must at least define one class in the component file otherwise
> it fails. even if you use include class

Makes sense.


> - specifying default values for scalar types (integer, boolean,
> string)

Yes, that is trivial.


> - support for class inheritance, this will save a lot of xml writing

This is another hairy problem that is on my plans to solve but I have
not yet figured all the solutions for each detail.


> - please provide more searchFilterExamples

That is done now. Practically all types of conditions that you can
impose with SQL expressions can be done with filters.


> - please explain the <parameters> <class> <id> and <argument> tags
> in a function definition like:
>   <function>
>     <name>getCategory</name>
>     <type>getobject</type>
>     <parameters>
>       <class>category</class>
>       <id>
>          <argument>category</argument>
>       </id>
>     </parameters>
>   </function>

I thought that the documentation was clear enough. I can try to improve it.


> Prio 3
> - to avoid name conflicts in PHP optionally allow to specify a
> package name that is automatically prepended to the name of
> generated data classes, e.g myShop_Categoryclass

I can add this as a generation option probably when I add setters and
getters support which is not a related feature but also be activated as
generation option controlled by a separate options XML file.


> - how about renaming <function> to <method> and <variable> to
> <property> these are more OOP like terms?

This is arguable. In PHP, class members are named functions and
variables. I could change it but it would probably displease people used
to that terminology. I can make alias wherever these are used but I
wonder if the effort that it would take would really be worth it when
there already so many other things that I think are more important to
implement.


> - how about renaming <validate> to <constraint>?

I think it is a matter of taste. The same that was said about renaming
function and variable applies to validation.


> - optionally use PHP5 private, protected and public for class
> properties and methods

That is something that is planned although it is mostly a formality that
   has no change in the functionality. It can be done after external
generation options file is supported.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#218 From: Manuel Lemos <mlemos@...>
Date: Wed May 19, 2004 4:30 am
Subject: Re: Re: Newbie How To Questions
mallemos
Send Email Send Email
 
Hello,

On 05/18/2004 08:14 PM, dooctor2000 wrote:
> Thanks for answering my questions so quickly. That really helped me.
> If it is just a quick fix I'd really like to see the a default value
> tag. I'm mainly interested in having this feature for boolean values.

If you meant assigning constant default values, that is not a big deal
at all. You also mentioned initializing variables with creating and last
update time. That is a little different and more complex.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#219 From: Manuel Lemos <mlemos@...>
Date: Wed May 19, 2004 5:01 am
Subject: Re: "Collection Variable Is Empty" Filter?
mallemos
Send Email Send Email
 
Hello,

On 05/18/2004 08:30 PM, dooctor2000 wrote:
> Hi,
> I found this example in the newsgroup:
> <function>
> <name>getrootcategories</name>
> <type>getallobjects</type>
> <parameters>
> <class>category</class>
> <filter>
> <isnull><variable>parent</variable></isnull>
> </filter>
> </parameters>
> </function>
>
> what do I have to write if the category can have multiple parent
> categories (m-n relation) and I want all categories that doesn't
> have a single parentCategory. isnull will propably not work or am I
> wrong?

isnull is just for (reference) variables . No variables are not envolved
in many-to-many relationships. In such kind of relationships, the
relation information is stored in intermediate table that is created
implicitly. To define many-to-many relationships you just define
collections in each of the related classes referencing each other. See
the documentation and tutorial for an example.

As for your question on how determine which objects of a given class are
not envolved in a relationship that is a tricky question. In SQL that
usually require sub-selects envolving the class table and the
relationship intermediate table.

SELECT class_a.* FROM class_a WHERE class_a.id NOT IN (SELECT class_a
FROM class_a_x_class_b)

Now how to translate that into some consistent syntax of the object
query filter language is something that I have not yet thought about.
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Messages 190 - 219 of 555   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help