Hello,
Although this was done more than one week ago, I have been very busy
with other developments and could not announce before that MetaL is now
capable of generating classes of objects like they were already being
generated for PHP. This means that the classes that were developed with
MetaL and some were released to the public in the PHP Classes
repository, can already be released wherever in form of Java code.
This was a very important step forward in the MetaL development because
unlike PHP, Java requires variables to be declared, and MetaL is now
capable to figure the types of the variables you use in class functions
and generate automatically classes code that declare such variables
although you don't need to declare them explicitly in MetaL code. This
means that now the whole MetaL engine is capable of supporting any
strong typing language like Java, but also others.
Other important capability, that MetaL is also able to keep track of the
exceptions that each class function throws. This is not very important
for PHP, but it is for Java.
See the attached examples of MetaL code and the code that was generated
by the MetaL compiler for PHP and Java. Notice also that despite Java
does not support it like PHP, MetaL is capable of doing some magic with
Java code by providing capabilities that currently it does not have,
like for instance switch/case constructs with String values (Java only
supports integers).
Another interesting consequence is that now it is also possible to
generate automatic documentation for classes for PHP and Java. This
means that the resulting document will show data types and example code
in the target language that was choosen. See also the generated HTML
example documentation for the same MetaL class. Also, unlike JavaDoc and
PHPDoc (AFAIK) MetaL is also able to generating documentation in
different idioms from the same MetaL class source code.
Since the latest changes broke almost all MetaL code to adapt it to deal
with Java limitations, I have not updated the CVS repository.
Well, for now I just need to write some conformance tests the certify
that the generated code works seeminglessly with all supported
languages. Then I also want to support the same features for generating
Perl code. Then I will finally be ready to Open MetaL as a full source
code project.
Until then,
Merry X-Mas to everybody,
Manuel Lemos
The class has several independent functions that should be used to compose the structure of a XML document. When the structure is fully composed the write should be used to output the document in the XML format.
Here follows an example of typical use of this class:
<?php
/*
* First create an object of the class.
*/
$xml_writer_object=new xml_writer_class;
/*
* Now, start defining the XML document from the root tag.
*/
$xml_writer_object->addtag("myxmldocument",array(),"",$root,1);
/*
* Then define the rest of the document tags and data.
*/
$xml_writer_object->addtag("name",array(),$root,$toptag,0);
$xml_writer_object->adddata("John Doe",$toptag,$path);
/*
* Tags may have attributes.
*/
$attributes=array();
$attributes["country"]="us";
$xml_writer_object->addtag("address",$attributes,$root,$toptag,1);
/*
* Tags and the correspondent data may be added with a single function call.
*/
$xml_writer_object->adddatatag("street",array(),"Wall Street, 1641",$toptag,$datatag);
$xml_writer_object->adddatatag("zip",array(),"NY 72834",$toptag,$datatag);
/*
* When you are done with the XML document definition, generate it.
*/
if($xml_writer_object->write($output))
{
/*
* If the document was generated successfully, you may not output it.
*/
echo $output;
}
else
{
/*
* If there was an error, output it as well.
*/
echo ("Error: ".$xml_writer_object->error);
}
?>
attributes - Associative array that defined the list of attributes of the tag, if any. The indexes of the array entries are the names of the attributes and the values array entries are the attribute values defined in encoding type specified by the inputencoding variable.
parent - Path of the parent XML document tag element within each which the new tag is being added. If the new tag is the document root tag, the parent path is "". The path of previously added tags is returned by the path argument of previous calls to this function.
path - Reference to a variable that will hold the path of the XML document tag element that is added by this function.
indent - Flag that determines if the elements to be added within this tag will be outputted in individual indented lines.
Return value
Success boolean flag. If this flag is 0 then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
parent - Path of the parent XML document tag element within each which the new data part is being added. The path of previously added tags is returned by the path argument of previous calls to the addtag function.
path - Reference to a variable that will hold the path of the XML document data part element that is added by this function.
Return value
Success boolean flag. If this flag is 0 then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
attributes - Associative array that defined the list of attributes of the tag, if any. The indexes of the array entries are the names of the attributes and the values array entries are the attribute values defined in encoding type specified by the inputencoding variable.
parent - Path of the parent XML document tag element within each which the new tag is being added. The path of previously added tags is returned by the path argument of previous calls to the addtag function.
path - Reference to a variable that will hold the path of the XML document tag element that is added by this function.
Return value
Success boolean flag. If this flag is 0 then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
The class has several independent functions that should be used to compose the structure of a XML document. When the structure is fully composed the write should be used to output the document in the XML format.
Here follows an example of typical use of this class:
{
Object xml_writer_object;
String root=null;
String toptag=null;
String path=null;
Hashtable attributes;
String datatag=null;
String output=null;
/*
* First create an object of the class.
*/
xml_writer_object=new xml_writer_class;
/*
* Now, start defining the XML document from the root tag.
*/
xml_writer_object.addtag("myxmldocument",new Hashtable(),"",root,true);
/*
* Then define the rest of the document tags and data.
*/
xml_writer_object.addtag("name",new Hashtable(),root,toptag,false);
xml_writer_object.adddata("John Doe",toptag,path);
/*
* Tags may have attributes.
*/
attributes=new Hashtable();
attributes.put("country","us");
xml_writer_object.addtag("address",attributes,root,toptag,true);
/*
* Tags and the correspondent data may be added with a single function call.
*/
xml_writer_object.adddatatag("street",new Hashtable(),"Wall Street, 1641",toptag,datatag);
xml_writer_object.adddatatag("zip",new Hashtable(),"NY 72834",toptag,datatag);
/*
* When you are done with the XML document definition, generate it.
*/
if(xml_writer_object.write(output))
{
/*
* If the document was generated successfully, you may not output it.
*/
System.out.print(output);
}
else
{
/*
* If there was an error, output it as well.
*/
System.out.print(("Error: "+xml_writer_object.error));
}
}
attributes - Associative array that defined the list of attributes of the tag, if any. The indexes of the array entries are the names of the attributes and the values array entries are the attribute values defined in encoding type specified by the inputencoding variable.
parent - Path of the parent XML document tag element within each which the new tag is being added. If the new tag is the document root tag, the parent path is "". The path of previously added tags is returned by the path argument of previous calls to this function.
path - Reference to a variable that will hold the path of the XML document tag element that is added by this function.
indent - Flag that determines if the elements to be added within this tag will be outputted in individual indented lines.
Return value
Success boolean flag. If this flag is false then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
parent - Path of the parent XML document tag element within each which the new data part is being added. The path of previously added tags is returned by the path argument of previous calls to the addtag function.
path - Reference to a variable that will hold the path of the XML document data part element that is added by this function.
Return value
Success boolean flag. If this flag is false then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
attributes - Associative array that defined the list of attributes of the tag, if any. The indexes of the array entries are the names of the attributes and the values array entries are the attribute values defined in encoding type specified by the inputencoding variable.
parent - Path of the parent XML document tag element within each which the new tag is being added. The path of previously added tags is returned by the path argument of previous calls to the addtag function.
path - Reference to a variable that will hold the path of the XML document tag element that is added by this function.
Return value
Success boolean flag. If this flag is false then the error variable contains the error message that explains the failure. This return value may be safely ignored if the function call arguments are correctly defined.
Hello,
Finally I made the proof of concept of MetaL by generating a class and a
test script from MetaL code in either PHP and Java. The code in both
languages performed the same task that was to generate a XML document
dynamically with tags and data defined in the test script.
This is a very important milestone as soon I will be able to release
MetaL to the general public as an Open Source project. The last step is
to make the proof of concept also with Perl. That should be easier than
with Java because Perl seems to be more flexible.
Anyway, I expect that to happen until the end of the month. For now I
will be taking 2 weeks off to give priority to some other projects of
mine.
Regards,
Manuel Lemos
Hello,
On 09/12/2002 12:29 PM, Marcus and Aviva wrote:
> Anyone working on some XSLT or other system to generate PHP code? In
> particular with respect to generating database schemas with PHP object
> wrappers. Database schema generators are already appearing (esp. Java),
> but no one seems to be working on a tool to generate the corresponding
> PHP classes either through the native PHP database functions or some
> intermediate layer (Binary Cloud, Metabase, PHPDo).
>
> Are you or anyone you know undertaking such a project? Do you/they want
> any help?
Coincidentally I am starting to work on a module for the MetaL compiler
engine that is meant to generate object persistent layers eventually to
SQL databases.
Like you mentioned it will pick component descriptions and generate
database schemas for SQL table mappings including any intermediate
tables that are needed for many to many relationships. It will also
generate classes in MetaL code that can be generated to any of the
supported languages.
PHP is naturally the most well supported language in the MetaL
development, but it can also generate Java and Perl. The advantage of
PHP in this case as since I rely on Metabase, the generated code will be
database agnostic, ie, it will work well with all supported databases.
And then, you may ask: what is MetaL?
Is is a meta-programming engine that makes possible to generate the same
program in different target languages from a language independent
program definition based in XML.
It is not yet released, but I planned to make it Open Source. I just did
not do it yet because I did not had the time to document it minimally,
but since now I need to develop this object persistence module to
develop the paid services sub-systems that I am working on for the PHP
Classes site, I have a good motivation to work on MetaL more.
Anyway, if you have tried some of my classes from the PHP Classes site,
you have most likely used MetaL generated code without knowing.
For more information, take a look at this page:
http://www.meta-language.net/
--
Regards,
Manuel Lemos
ola,
hopefully this isn't butting in manuel :)
>> Anyone working on some XSLT or other system to generate PHP code? In
>> particular with respect to generating database schemas with PHP object
>> wrappers.
Manuel is doing a project called MetaL which is effectively an XML code
representation -> PHP (or whatever other language).
binarycloud has a means of:
-writing an "entity definition" XML
-ripping:
-schema (XML in metabase format)
-"data access class" - binarycloud entity record class.
So, depending on what you're trying to do, Metal may be what you're looking
for, or that part of binarycloud may be what you're looking for.
> Database schema generators are already appearing (esp. Java),
>> but no one seems to be working on a tool to generate the corresponding
>> PHP classes either through the native PHP database functions or some
>> intermediate layer (Binary Cloud, Metabase, PHPDo).
Yes we have it!
>> Are you or anyone you know undertaking such a project? Do you/they want
>> any help?
> Coincidentally I am starting to work on a module for the MetaL compiler
> engine that is meant to generate object persistent layers eventually to
> SQL databases.
Yep cool :)
> Like you mentioned it will pick component descriptions and generate
> database schemas for SQL table mappings including any intermediate
> tables that are needed for many to many relationships. It will also
> generate classes in MetaL code that can be generated to any of the
> supported languages.
That's very cool. At the moment we do not have extremely sophisticated
schema generation capabilities based on entity definitions - we will. That's
where we could use some help.
> Anyway, if you have tried some of my classes from the PHP Classes site,
> you have most likely used MetaL generated code without knowing.
Yep :)
When Manuel releases metal open source, I want to try and get standard metal
templates working with binarycloud :)
> For more information, take a look at this page:
>
> http://www.meta-language.net/
>
_alex
Hello,
On 09/13/2002 03:21 PM, Alex Black wrote:
>>>Anyone working on some XSLT or other system to generate PHP code? In
>>>particular with respect to generating database schemas with PHP object
>>>wrappers.
>>
>
> Manuel is doing a project called MetaL which is effectively an XML code
> representation -> PHP (or whatever other language).
>
> binarycloud has a means of:
> -writing an "entity definition" XML
> -ripping:
> -schema (XML in metabase format)
> -"data access class" - binarycloud entity record class.
>
> So, depending on what you're trying to do, Metal may be what you're looking
> for, or that part of binarycloud may be what you're looking for.
I have studied several object-relational (O/R) data abstraction layers
(DAL), some more complete than others. I mostly disliked those that rely
on fat base classes or try to do more than just doing object persistence
and do other things like user interface handling.
I liked most of those that just generate code but still it seems that
some generate all the code that you possibly can use but in real
applications you may not need all the methods. So, this is a point to
keep in mind: generate only the code that the developer will hint that
is necessary.
The one that impressed me most is PragmaTier. It generates DAL code in
components that contain the definition of related entities to be
persisted via SQL databases. They have a Component Definition language
that seems very easy but is in some custom format, so it is not XML.
http://www.pragmatier.com/
I also looked at you entity persistence layer. It seems more or less
like what I would like but definitly without those database schema
definitions because that is precisely what I want to avoid to manage
manually.
Too bad that the methods documentation is missing. Do you plan to
document that soon?
>>Database schema generators are already appearing (esp. Java),
>>
>>>but no one seems to be working on a tool to generate the corresponding
>>>PHP classes either through the native PHP database functions or some
>>>intermediate layer (Binary Cloud, Metabase, PHPDo).
>>
>
> Yes we have it!
My plan is to generate Metabase specific code for DAL classes. However,
I would like to keep an open evolution path to generate database
specific stored procedure based code to be abstracted by a MetaL
compiler module that will provide the support for generating stored
procedures for the most used databases that support them and will work
as an alternative to Metabase specific client code that will still be
generated for databases that do not support stored procedures.
This way it will achieve maximum performance while keeping the high
level of the abstraction. Anyway, this is just a bold idea that it will
probably take a long time to happen because it is not a priority.
>>>Are you or anyone you know undertaking such a project? Do you/they want
>>>any help?
>>
>
>>Coincidentally I am starting to work on a module for the MetaL compiler
>>engine that is meant to generate object persistent layers eventually to
>>SQL databases.
>
>
> Yep cool :)
>
>
>>Like you mentioned it will pick component descriptions and generate
>>database schemas for SQL table mappings including any intermediate
>>tables that are needed for many to many relationships. It will also
>>generate classes in MetaL code that can be generated to any of the
>>supported languages.
>
>
> That's very cool. At the moment we do not have extremely sophisticated
> schema generation capabilities based on entity definitions - we will. That's
> where we could use some help.
Yes, at least some brainstorming would be helpful. What I have in mind
is definining a very simple XML format that will resemble the component
definition language of Pragmatier. It may be as simple as BinaryCloud
entity definition format without the database schema specific tags.
Anyway, my main goal is to complete the software project development
cycle. I have defined some XML formats for project specification, risk
analysis, sub-system architecture, use case and actor definition. Now I
want to some how to evolve and document project key abstractions to
define the component structure. The entity abstractions will be defined
via the component format that will be used to generate the DAL classe,
but I still haven't all figured out.
>>Anyway, if you have tried some of my classes from the PHP Classes site,
>>you have most likely used MetaL generated code without knowing.
>
>
> Yep :)
>
> When Manuel releases metal open source, I want to try and get standard metal
> templates working with binarycloud :)
I was considering to move all the stuff to a project in the tigris.org .
I wanted to ask you about how smooth the transition may occur. Do you
have access to the project CVS repository maybe via SSH, so you can
manipulate it directly if necessary? Since it is all related, I may move
Metabase over there too, but I need to know if I will still have direct
control over CVS files.
>>For more information, take a look at this page:
>>
>>http://www.meta-language.net/
>
--
Regards,
Manuel Lemos
Hello,
On 09/14/2002 12:11 AM, Marcus and Aviva wrote:
>> Coincidentally I am starting to work on a module for the MetaL
>> compiler engine that is meant to generate object persistent layers
>> eventually to SQL databases.
>>
>> Like you mentioned it will pick component descriptions and generate
>> database schemas for SQL table mappings including any intermediate
>> tables that are needed for many to many relationships. It will also
>> generate classes in MetaL code that can be generated to any of the
>> supported languages.
>
> In what format is the model defined?
It is not defined yet because I am just starting to work on it.
>> And then, you may ask: what is MetaL?
>
>
> I did not get to any example source code.
Actually when you see the MetaL ingredients and recipe steps you will
see a file icon at the bottom that you can click to open some MetaL XML
source files.
> I read through the slides. I am only currently interested in getting
> from MOF or XMI files (from UML tools) to SQL with PHP wrappers. I am
> more than half way to producing such a system as part of other work.
I understand that maybe you want to use MOF and XMI to integrate with
some tool that generates project files in such formats, right? If so,
what tools are you using? Rational Rose?
Anyway, I looked superficially at those formats and I did not like them
much because they rely on non-SML conformant structure as they use
attributes in XML tags. I wish XML designers avoided that because you
can't extend XML attributes as you can't use XML tags in attributes.
Anyway, it is very likely that I define a new format, maybe inspired in
Binary Cloud entity definition and also on Pragmatier component
definition language that is not XML but it is very easy to adapt and it
already addresses the issues of defining persistence layers to generate
classes automatically from such definitions.
Anyway, if you are looking for something already developed in PHP, you
may want to take a look at Binary Cloud that already has components for
generating code to manage entities.
> Thank you Manuel. I kind of thought you might be the one to reply. ;-)
I hope that means something good .
--
Regards,
Manuel Lemos
Hello,
On 09/16/2002 05:34 AM, alex black wrote:
>>I liked most of those that just generate code but still it seems that
>>some generate all the code that you possibly can use but in real
>>applications you may not need all the methods. So, this is a point to
>>keep in mind: generate only the code that the developer will hint that
>>is necessary.
>
>
> That's what we do in BC. There's a base of methods but nothing beyond
that.
> We don't try to do your job for you, we just make it easier to get
set up.
I don't know if you got what I mean. I meant all DAL code is generated
by MetaL, so I plan to not need any base classes to inherit from. Each
entity will be implemented by one class only. It only will have methods
that the application needs. For instance, if the application does not a
delete method, it will not have a delete method. So, no useless code
will be generated.
>>I also looked at you entity persistence layer. It seems more or less
>>like what I would like but definitly without those database schema
>>definitions because that is precisely what I want to avoid to manage
>>manually.
>
>
> What definition file did you look at?
One from the specifications book.
> The point of entity definitions is that they are a superset of the
> information you need for a particular task - the entity definition
> represents all information you need to have about a set of fields in any
> context.
I would not attach component properties to specific database table
fields. It may turn out that you decide to map things differently for a
specific component, or even use a different persistence layer other than
a SQL database. I think it would be better to specify the database
mappings if necessary in some other file. The Pragmatier format seems
more elegant.
> So there's some DB schema stuff in there if you're usig a SQL database,
> there's bits of information about default presentation, and of course
a lot
> of field metadata.
>
> I think keeping all of that information in once place makes it _very_
easy
> to manage the whole system and make updates, etc.
>
> We generate .schema files from entity definitions automatically - so you
> only have to write one file.
Well, you seem to have to define database fields by hand anyway which
should be a thing that you needed to avoid in first place, IMHO.
>>Too bad that the methods documentation is missing. Do you plan to
>>document that soon?
>
>
> There will be a complete code audit before binarycloud r2 RC1 is
released -
> so all of that stuff will be added/checked/etc.
Any target dates?
>>>That's very cool. At the moment we do not have extremely sophisticated
>>>schema generation capabilities based on entity definitions - we will.
>>
> That's
>
>>>where we could use some help.
>>
>>Yes, at least some brainstorming would be helpful. What I have in mind
>>is definining a very simple XML format that will resemble the component
>>definition language of Pragmatier. It may be as simple as BinaryCloud
>>entity definition format without the database schema specific tags.
>
>
> Well, those are necessary if you're in SQL-land. I don't think you
want to
> leave everything to a "generator" - I would prefer to have the option of
> control over specific things in the DB. Admittadly we could leave
sequence
> and index definition/generation to a tool... but even in that case
one could
> make counter-arguments.
That seems contradicting the goal of persistency layers. The way I see
it, persistency layers are meant to avoid having you to code any SQL by
hand. Sure you may parameterize certain things like filter criteria and
so, but not schema management or standard Add/List/Update/Delete
operations. The way I see it, you just define properties, types, keys,
relationships and probably not much else, and the generator should
generate schemas and DAL classes code for you.
I don't see any particular situation where you need to specify for
instance table names because the generated DAL code will already know
where are things, unless you want to map legacy databases where the
tables and fields you need to map are those that already exist and so
are not created by the schema generator.
>>Anyway, my main goal is to complete the software project development
>>cycle. I have defined some XML formats for project specification, risk
>>analysis, sub-system architecture, use case and actor definition. Now I
>>want to some how to evolve and document project key abstractions to
>>define the component structure. The entity abstractions will be defined
>>via the component format that will be used to generate the DAL classe,
>>but I still haven't all figured out.
>
>
> Cool, I think some of that could be integrated with binarycloud to all of
> our benefit.
Unless I am see your entity package incorrectly, this is probably
something you already have. I would have to see more documentation of
that package.
>>I was considering to move all the stuff to a project in the tigris.org .
>>I wanted to ask you about how smooth the transition may occur. Do you
>>have access to the project CVS repository maybe via SSH, so you can
>>manipulate it directly if necessary? Since it is all related, I may move
>>Metabase over there too, but I need to know if I will still have direct
>>control over CVS files.
>
>
> You don't have direct control over the top level repository.
>
> That also made me nervous at first but they are _EXTREMELY_ cool people,
> I've had nothing but good experiences with them. If I need something, I
> ask... and they get it done quick. Very cool.
>
> I needed an MBOX export of the list archives for MARC, jason @
collabNet had
> it done in ~3 hours.
humm... I think it is better to stick to my own CVS repository then.
--
Regards,
Manuel Lemos
Hello,
On 09/16/2002 09:21 PM, Marcus and Aviva wrote:
>> I understand that maybe you want to use MOF and XMI to integrate with
>> some tool that generates project files in such formats, right? If so,
>> what tools are you using? Rational Rose?
>
>
> None yet. I am moving our own formats into these formats for future
> compatibility with this these tools. This type of tool is very expensive
> (of the order of 20000 ukpounds for a three seat set-up) and so not
> something we want to jump into until the pieces are in place. PHP is not
> the only language that we use, but it is a pretty key component.
You may want to try this program: http://uml.sourceforge.net/ . It
supports XMI and generates Java and C++. It does not update previously
generated classes though. But it is already very good for a Open Source
UML modeller.
>> Anyway, I looked superficially at those formats and I did not like
>> them much because they rely on non-SML conformant structure as they
>> use attributes in XML tags. I wish XML designers avoided that because
>> you can't extend XML attributes as you can't use XML tags in attributes.
>
>
> I have only just started looking at XMI. You have hit me in my
> abbreviation impairment spot. What is SML? I agree with you on the dead
SML is Simplified XML or Minimal XML. It does not use tag attributes or
characters entities.
> end nature of attributes, but although rather final they are easy to
> parse. And easier on the human eye. What particular problem did you have
> (with XMI) or was it general distaste?
That is just one problem. Another problem, which may not quite be of XMI
but of UML is that your project does not start in use cases. So, you do
not start modelling from graphics but rather from some text document
specification that includes requirements and eventually risk analisis.
Only then, you start modelling your system in use cases actors and
eventually distributing them among sub-systems that you divide according
to a convinient architecture.
You can use UML to document this, but UML is just a graphical help. If
the UML editor does not support a detailed level of documentation that
is insuficient.
That is why I defined my own XML formats to document project
description, requirements, risks, sub-system architecture, actors, use
cases with scenario flow step description and so on. I could not be sure
if XMI supports all this. What I could realized is that in the worst
case I can generate or update XMI files from my XML formats for the
usual incremental project design workflow.
>> Anyway, if you are looking for something already developed in PHP, you
>> may want to take a look at Binary Cloud that already has components
>> for generating code to manage entities.
>
>
> Binary Cloud is the front runner.
>
> I don't yet want to port current projects from our own persistence
> mechanism, even at the expense of reinventing the wheel a little, unless
> there is a big and immediate win.
Yes, it would not be advisable to redo what already works suitably.
> Current plan...
> 1) Refactor current project to use XMI for the DB schemas.
> 2) Switch from our current homebrew XML/PHP to this system.
> 3) Buy some flash UML tool and never write a line of code again!
>
> :-)
That is just for modelling entities. You still have to write code for
business components, even if you can do that from inside the UML tool
you buy.
>>> Thank you Manuel. I kind of thought you might be the one to reply. ;-)
>>
>> I hope that means something good .
>
> Of course it does.
:-)
--
Regards,
Manuel Lemos
> Never used this tool, but I have heard good thingd about it. So it may
> or may not do what you guys need: http://argouml.tigris.org/
PoseidonURL is very good, based on Argo.
No class generation...
I'm inclined to use a charting tool like OmniG to create UML diagrams that
people just use as guides.
> Then another general comment. Something that may also make sense is take
> a common open format and if you don't like its internal formatting (like
> non SML etc.) write an XSL to convert to your format.
We have that in binarycloud, works REALLY WELL.
> Anyways hopefully my comment were useful, since I did not really dive
> deep into what you guys are talking about.
:)
_a
Hello,
On 09/17/2002 03:52 AM, Lukas Smith wrote:
>>You may want to try this program: http://uml.sourceforge.net/ . It
>>supports XMI and generates Java and C++. It does not update previously
>>generated classes though. But it is already very good for a Open
>
> Source
>
>>UML modeller.
>>
>
>
> Never used this tool, but I have heard good thingd about it. So it may
> or may not do what you guys need: http://argouml.tigris.org/
Yes, I tried that in the past but I gave up because just for modelling
it seemed very complete but I dropped it because it was not good for
documentation which is what I was looking for then. It also did not look
like it would be able to save as XMI, but I don't know about that today.
> Then another general comment. Something that may also make sense is take
> a common open format and if you don't like its internal formatting (like
> non SML etc.) write an XSL to convert to your format.
Yes, that is a possibility. Anyway what I am looking for now is
something that generates DAL classes and database schemas from component
descriptions so I never have to write any more SQL for implementing
persistence layers. This provides a huge speedup to medium to large
sized applications.
--
Regards,
Manuel Lemos
Hello,
Finally I made time to put together a release of MetaL for public
evaluation.
I am not yet announcing this widely because I need some feedback on the
material that I just made available. So, please go to MetaL site and
evaluate specifically the MetaL FAQ page and the archives available for
download and let me know if all is easy to understand and if is there
any information that you feel that is missing:
http://www.meta-language.net/
--
Regards,
Manuel Lemos
Hello,
Finally I was able to make a initial release of MetaL persistence module.
There is a more detailed news release in the page below, but basically
this a new meta-meta-programming module for the MetaL compiler engine
that is able to generate an API that implements a persistence layer to
store and retrieve objects in persistence storage.
It takes a description of classes of entity objects in XML and generates
all the classes and schemas that are needed to provide the persistence
API. There is much more detail in the news page below.
Anyway, this module is an alpha stage. I just released it now because I
would like some feedback on the usage of the module from people that
know data persistence layers and make some criticisms so I can spot any
design issues early in the development of this module.
Currently, I have provide a sample component than you can try simply by
going into metal/test/persistence and do:
php -q build.php some.component
I have provided an example component that could be the what a normal
Content Management System needs in terms of objects that need to be
persisted. In the same directory take a look at cms.component . Build it
with the command line:
php -q build.php cms.component
You will see that inside a directory named install it created several
classes: a factory class, a few classes for each one defined in the
cms.component XML file, a schema installation class and a database
schema definition in a XML format.
Although there could be other types of persistent storage (XML files,
LDAP, etc..), currently MetaL persistence layer only generates code to
interface to SQL based relational databases.
Currently it uses Metabase API to interface with databases. PEAR::MDB is
expected to work with Metabase API wrapper. It could use other database
API and maybe in the future it will, but for now Metabase is very
adequate because it is portable (many databases supported with the same
code) and provides schema management with schema definitions in XML.
Anyway, if you are interested in these subjects, please take a look and
follow up to MetaL mailing list (metal-dev@yahoogroups.com) or mail me
privately (mlemos@...).
http://www.meta-language.net/news-2002-11-01-persistence.html
--
Regards,
Manuel Lemos
Hello,
Finally I made time to release a full blown application based on MetaL
compiler persistence module.
Here is the release announcement that may also be found on the site:
http://www.meta-language.net/news-2002-12-05-metastorage.html
_________________________________________________________________
Released Metastorage generator
Manuel Lemos, 2002-12-05 16:11:44 GMT
Metastorage is an application that is capable of generating
persistence layer APIs. It takes a component definition defined in the
Component Persistence Markup Language (CPML), a XML based format, and
generates classes and storage schemas in a given target programming
language.
Using CPML, developers can focus their efforts on the modeling of data
structures that hold the information and the relationships between the
entities that their applications deal with. Metastorage takes care of
generating all the necessary code to store and retrieve such data
structures from persistent storage containers like relational
databases.
The main goal of Metastorage is to drastically reduce the time to
develop applications that traditionally use on SQL based relational
databases.
The generated APIs consist of a sets of classes that provide an Object
Oriented interface to the objects of the classes modeled using CPML.
The generated APIs are also capable of installing the data schema in
the persistence container, which in the case of a relational database
is the set of tables that will hold the persistent objects. This
completely eliminates the need to write any SQL queries manually.
CPML is independent of the type of persistent container. This means
that while it can be used to model classes of persistent objects that
may be stored in relational databases, such objects may as well be
stored in other types of persistence containers.
For instance, if an application needs to move a directory of objects
with user information from a relational database to a LDAP server to
increase the application scalability, the same CPML component
definition would be used. Metastorage would then generate classes
objects that implement the same API for interfacing with a LDAP server
that is compatible with the API generated to interface with relational
databases. This make the migration process easier and with reduced
risks.
Another possible benefit of the persistence container independence of
the APIs generated by Metastorage, is the case where an application
may need to run in environments where a SQL based database server is
not available. In that case the same API could be generated to store
persistent objects in flat file databases or plain XML files.
For now, the current version of Metastorage only supports the
generation of PHP code based on the database independent Metabase API.
This means that it may also interface with PEAR::MDB database
abstraction layer using its built-in Metabase API wrapper. In
consequence, many types of relational databases are already supported.
Since this is the first release of Metastorage, there is plenty of
room for improvement in the possibilities of the generated persistence
APIs and the level of optimization of the generated code. In the
future it will be supported other languages besides PHP, other
database APIs besides Metabase and other persistence containers
besides relational databases.
Metastorage is based on MetaL compiler persistence module. Like MetaL,
Metastorage is Open Source and is distributed with BSD like software
license. Downloadable archives and documentation with an example of
component definition are available from the MetaL site.
--
Regards,
Manuel Lemos
Fala Manuel,
Nossa...
foi bom me mandar esse email...
lembrei que tenho que traduzir a apresentação do metal..
vou ver se consigo essa semana,
ou antes da proxima reuniao que é semana que vem..
alguma coisa que queira inserir na apresentação?
[]'s Alessander
At 15:14 05/12/02 -0200, you wrote:
>Hello,
>
>Finally I made time to release a full blown application based on MetaL
>compiler persistence module.
>
>Here is the release announcement that may also be found on the site:
>
>http://www.meta-language.net/news-2002-12-05-metastorage.html
>
> _________________________________________________________________
>
>Released Metastorage generator
>Manuel Lemos, 2002-12-05 16:11:44 GMT
>
>Metastorage is an application that is capable of generating
>persistence layer APIs. It takes a component definition defined in the
>Component Persistence Markup Language (CPML), a XML based format, and
>generates classes and storage schemas in a given target programming
>language.
>
>Using CPML, developers can focus their efforts on the modeling of data
>structures that hold the information and the relationships between the
>entities that their applications deal with. Metastorage takes care of
>generating all the necessary code to store and retrieve such data
>structures from persistent storage containers like relational
>databases.
>
>The main goal of Metastorage is to drastically reduce the time to
>develop applications that traditionally use on SQL based relational
>databases.
>
>The generated APIs consist of a sets of classes that provide an Object
>Oriented interface to the objects of the classes modeled using CPML.
>
>The generated APIs are also capable of installing the data schema in
>the persistence container, which in the case of a relational database
>is the set of tables that will hold the persistent objects. This
>completely eliminates the need to write any SQL queries manually.
>CPML is independent of the type of persistent container. This means
>that while it can be used to model classes of persistent objects that
>may be stored in relational databases, such objects may as well be
>stored in other types of persistence containers.
>
>For instance, if an application needs to move a directory of objects
>with user information from a relational database to a LDAP server to
>increase the application scalability, the same CPML component
>definition would be used. Metastorage would then generate classes
>objects that implement the same API for interfacing with a LDAP server
>that is compatible with the API generated to interface with relational
>databases. This make the migration process easier and with reduced
>risks.
>
>Another possible benefit of the persistence container independence of
>the APIs generated by Metastorage, is the case where an application
>may need to run in environments where a SQL based database server is
>not available. In that case the same API could be generated to store
>persistent objects in flat file databases or plain XML files.
>
>For now, the current version of Metastorage only supports the
>generation of PHP code based on the database independent Metabase API.
>This means that it may also interface with PEAR::MDB database
>abstraction layer using its built-in Metabase API wrapper. In
>consequence, many types of relational databases are already supported.
>
>Since this is the first release of Metastorage, there is plenty of
>room for improvement in the possibilities of the generated persistence
>APIs and the level of optimization of the generated code. In the
>future it will be supported other languages besides PHP, other
>database APIs besides Metabase and other persistence containers
>besides relational databases.
>
>Metastorage is based on MetaL compiler persistence module. Like MetaL,
>Metastorage is Open Source and is distributed with BSD like software
>license. Downloadable archives and documentation with an example of
>component definition are available from the MetaL site.
>
>
>--
>
>Regards,
>Manuel Lemos
>
>
>
>
>To unsubscribe from this group, send an email to:
>metal-dev-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
_______________________________________________________________________
Yahoo! Encontros
O lugar certo para encontrar a sua alma gêmea.
http://br.encontros.yahoo.com/
Sorry,
This email not is public list, are is private to manuel lemos.
Best Resgards,
Alessander Thomaz
At 15:25 05/12/02 -0200, you wrote:
>Fala Manuel,
>Nossa...
>foi bom me mandar esse email...
>lembrei que tenho que traduzir a apresentação do metal..
>
>vou ver se consigo essa semana,
>ou antes da proxima reuniao que é semana que vem..
>
>alguma coisa que queira inserir na apresentação?
>
>[]'s Alessander
>
>
>At 15:14 05/12/02 -0200, you wrote:
> >Hello,
> >
> >Finally I made time to release a full blown application based on MetaL
> >compiler persistence module.
> >
> >Here is the release announcement that may also be found on the site:
> >
> >http://www.meta-language.net/news-2002-12-05-metastorage.html
> >
> > _________________________________________________________________
> >
> >Released Metastorage generator
> >Manuel Lemos, 2002-12-05 16:11:44 GMT
> >
> >Metastorage is an application that is capable of generating
> >persistence layer APIs. It takes a component definition defined in the
> >Component Persistence Markup Language (CPML), a XML based format, and
> >generates classes and storage schemas in a given target programming
> >language.
> >
> >Using CPML, developers can focus their efforts on the modeling of data
> >structures that hold the information and the relationships between the
> >entities that their applications deal with. Metastorage takes care of
> >generating all the necessary code to store and retrieve such data
> >structures from persistent storage containers like relational
> >databases.
> >
> >The main goal of Metastorage is to drastically reduce the time to
> >develop applications that traditionally use on SQL based relational
> >databases.
> >
> >The generated APIs consist of a sets of classes that provide an Object
> >Oriented interface to the objects of the classes modeled using CPML.
> >
> >The generated APIs are also capable of installing the data schema in
> >the persistence container, which in the case of a relational database
> >is the set of tables that will hold the persistent objects. This
> >completely eliminates the need to write any SQL queries manually.
> >CPML is independent of the type of persistent container. This means
> >that while it can be used to model classes of persistent objects that
> >may be stored in relational databases, such objects may as well be
> >stored in other types of persistence containers.
> >
> >For instance, if an application needs to move a directory of objects
> >with user information from a relational database to a LDAP server to
> >increase the application scalability, the same CPML component
> >definition would be used. Metastorage would then generate classes
> >objects that implement the same API for interfacing with a LDAP server
> >that is compatible with the API generated to interface with relational
> >databases. This make the migration process easier and with reduced
> >risks.
> >
> >Another possible benefit of the persistence container independence of
> >the APIs generated by Metastorage, is the case where an application
> >may need to run in environments where a SQL based database server is
> >not available. In that case the same API could be generated to store
> >persistent objects in flat file databases or plain XML files.
> >
> >For now, the current version of Metastorage only supports the
> >generation of PHP code based on the database independent Metabase API.
> >This means that it may also interface with PEAR::MDB database
> >abstraction layer using its built-in Metabase API wrapper. In
> >consequence, many types of relational databases are already supported.
> >
> >Since this is the first release of Metastorage, there is plenty of
> >room for improvement in the possibilities of the generated persistence
> >APIs and the level of optimization of the generated code. In the
> >future it will be supported other languages besides PHP, other
> >database APIs besides Metabase and other persistence containers
> >besides relational databases.
> >
> >Metastorage is based on MetaL compiler persistence module. Like MetaL,
> >Metastorage is Open Source and is distributed with BSD like software
> >license. Downloadable archives and documentation with an example of
> >component definition are available from the MetaL site.
> >
> >
> >--
> >
> >Regards,
> >Manuel Lemos
> >
> >
> >
> >
> >To unsubscribe from this group, send an email to:
> >metal-dev-unsubscribe@yahoogroups.com
> >
> >
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>_______________________________________________________________________
>
>Yahoo! Encontros
>
>O lugar certo para encontrar a sua alma gêmea.
>
>http://br.encontros.yahoo.com/
>
>
>
>To unsubscribe from this group, send an email to:
>metal-dev-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
_______________________________________________________________________
Busca Yahoo!
O melhor lugar para encontrar tudo o que você procura na Internet
http://br.busca.yahoo.com/
Hello,
As announced last week, Metastorage is an application that generates
customizable APIs made of classes that store and retrieve objects stored
in persistent storage containers like for instance relational databases.
The generated code uses Metabase API and consequently supports PEAR::MDB
via Metabase API wrapper.
In addition to that, the current version is also capable of generating
automatically Entity-Relationship graphs using UML to present diagrams
of the generated classes.
The generated Entity-Relationship graphs are described in the DOT
language format. This format is used by the Graphviz software package
from AT&T research labs. The DOT file can be rendered in many common
image formats using Graphviz tools to generate a graph image.
An example of an Entity-Relationship UML diagram generated by the
program from a component example definition is included in the
Metastorage documentation.
Here you may find the complete announcement with example graphics and
the relevant links:
http://www.meta-language.net/news-2002-12-09-metastorage.html
--
Regards,
Manuel Lemos
Is there an example available anywhere that demonstrates how the
generated data classes / factory class should be interfaced within an
external PHP script? The documentation does not illustrate this.
My first inclination would be something like:
include("cms.php");
include("article.php");
$article = new articleclass();
//print_r($article);
Thanks.
jason
Hello,
On 12/14/2002 07:38 PM, Jason Hines wrote:
> Is there an example available anywhere that demonstrates how the
> generated data classes / factory class should be interfaced within an
> external PHP script? The documentation does not illustrate this.
Yes, you are right, the documentation needs to be improved on this
aspect. I will try to provide something in that direction soon.
> My first inclination would be something like:
>
> include("cms.php");
> include("article.php");
Yes...
> $article = new articleclass();
No, objects should be created by the factory class, calling functions
defined the component XML definition. These functions can be to create a
new object from scratch or to create objects retrieved from the
persistence contains which in the current Metastorage version can only
be a relational database.
I will provide a better example later, but a possible script to create
and persist an article object would look like this:
require("cms.php");
require("article.php");
$factory=&new cmsclass;
$factory->connection="mysql://localhost/cms";
$factory->includepath="metabase/relative/path/to/script";
if($factory->initialize())
{
$article=$factory->createarticle();
if($article!=null)
{
$article->title="My first article";
$article->persistarticle();
}
$factory->finalize();
}
if(strlen($factory->error))
echo "Error: ".$factory->error;
--
Regards,
Manuel Lemos
First of all, I have to say that I really like the metastorage app.
Anything that makes work simpler is a Good Idea :)
I've trying to test some metastorage generated classes, and I'm
encountering a data consistency problem. I'm using the metastorage
tarball from the website, not CVS.
When I call the persist method on an object, and then try to retrieve
all the objects, the newly added object hasn't been saved yet:
$factory=....(init code)
// create a new User object
$user=$factory->createUser();
$user->username="abc";
$user->persist();
// list all User objects
$users=$factory->getAllUsers();
foreach($users as $u) print "id=$u->id, username=$u->username<br>";
$factory->finalize();
print "done";
-------------------------
output:
id=3, username=abc
id=4, username=abc
id=5, username=abc
id=6, username=
done
-------------------------
The next time I run the script, id=6 will have a username and id=7
will now be blank. It seems that the object doesn't actually get saved
until finalize() is called on the factory. If I call finalize() and
re-initialize the factory between the persist() and getAllUsers()
calls, it works properly and all the User objects are properly
retrieved.
Is there a way of avoiding having to re-initialize the factory between
calls?
Thanks,
Wil
Hello,
On 12/31/2002 01:21 PM, wgollino wrote:
> First of all, I have to say that I really like the metastorage app.
> Anything that makes work simpler is a Good Idea :)
>
> I've trying to test some metastorage generated classes, and I'm
> encountering a data consistency problem. I'm using the metastorage
> tarball from the website, not CVS.
>
> When I call the persist method on an object, and then try to retrieve
> all the objects, the newly added object hasn't been saved yet:
>
> $factory=....(init code)
>
> // create a new User object
> $user=$factory->createUser();
Here is the problem. PHP object assignment creates a new object. Change
this to:
$user=&$factory->createUser();
> Is there a way of avoiding having to re-initialize the factory between
> calls?
Initializing the factory is only needed once per script. It is meant to
setup the database connection so you can't get away with it. I could
make it a constructor but you would still need to call finalize at the
script end because PHP 4 does not support destructors except when using
some ugly hacks.
Hopefully when PHP 5 is out I can make Metastorage generate optionally
optimized code that is nicer.
Happy new year 2003 to everybody.
--
Regards,
Manuel Lemos
Hi,
That solved the problem. Thanks!
- Willie Gollino
--- In metal-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
> Hello,
>
> On 12/31/2002 01:21 PM, wgollino wrote:
> > First of all, I have to say that I really like the metastorage
app.
> > Anything that makes work simpler is a Good Idea :)
> >
> > I've trying to test some metastorage generated classes, and I'm
> > encountering a data consistency problem. I'm using the metastorage
> > tarball from the website, not CVS.
> >
> > When I call the persist method on an object, and then try to
retrieve
> > all the objects, the newly added object hasn't been saved yet:
> >
> > $factory=....(init code)
> >
> > // create a new User object
> > $user=$factory->createUser();
>
> Here is the problem. PHP object assignment creates a new object.
Change
> this to:
>
> $user=&$factory->createUser();
>
>
> > Is there a way of avoiding having to re-initialize the factory
between
> > calls?
>
> Initializing the factory is only needed once per script. It is
meant to
> setup the database connection so you can't get away with it. I
could
> make it a constructor but you would still need to call finalize at
the
> script end because PHP 4 does not support destructors except when
using
> some ugly hacks.
>
> Hopefully when PHP 5 is out I can make Metastorage generate
optionally
> optimized code that is nicer.
>
> Happy new year 2003 to everybody.
>
> --
>
> Regards,
> Manuel Lemos
Hi,
> -----Original Message-----
> From: metal-dev Moderator [mailto:metal-dev-owner@yahoogroups.com]
>
> MetaL code repository is available by CVS at: cvs.meta-language.net
Due to the company network I am unable to access non "standard" ports due to
the firewall.
This has prevented me from connecting to CVS outside the buidling. As a work
around I wondered if there was a CVS frontend available, or if it is planned
anytime soon?
At least then I could see what has been updated and maybe download it via
that interface - like the PEAR project works.
Regards,
Mike Carter
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Thanks for your correspondence - I feel a lot happier about the whole thing
now - it has just taken a whole day of reading the manual, your replies and
cms.component to get to grips with most things and why you use them where
you do - two little things still have me a bit befuddled.
Mike has verbally told me that you can have several components that talk to
the same database provided every class within the component is in the same
component as one it depends on or has to talk to. How do you set the create
database option to only create one database and not one for every component?
Finally - I don't really understand how the addtocollection type function
works - it might be because it's last thing on a Friday and my brain is
fried but would you mind running over it with me and then I can get my
thinking gear around it at some point on Monday?
I appreciate your help up to now and thanks in advance for this
Regards
Steve Fisk
Web Application Developer
KOA Solutions Ltd
Tel : 01925 758229
FAX : 01925 758023
This message is confidential.
Unless you are the named addressee or their delegated representative you may
not use, disclose, or copy the contents of the e-mail.
If you are not the named addressee please notify the sender immediately and
delete the material from your computer.
Any views or opinions contained in this e-mail are solely those of the
author unless expressly stated otherwise
-----Original Message-----
From: Manuel Lemos [mailto:mlemos@...]
Sent: 17 January 2003 02:44
To: Steve Fisk
Subject: Re: Metastorage
Hello,
On 01/16/2003 04:14 PM, Steve Fisk wrote:
> Is there a set of functions that you would recommend in each class and
> some that are more specific to Factory? We are starting to understand
> things a little better now – think we have figured out how the
> collection tags work - but are still not sure which functions it is
> important to have in each class and which in the factory class. Have
> you got any suggestions to that effect or any more detailed examples
> than cms.component that we could look at?
It is actually very simple. Either the factory or the classes will only
have the functions that you declare in the component definition.
The factory will have functions that create object either from scratch
or retrieving them from the database, like create a new object of this
class or get me all objects of this class.
The classes will have functions that to execute actions on objects that
are already created like save this object to the database or get me all
objects of some class collection that relate to this object.
--
Regards,
Manuel Lemos
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 06/01/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 06/01/2003
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Hello,
On 01/17/2003 02:22 PM, Mike Carter wrote:
>>MetaL code repository is available by CVS at: cvs.meta-language.net
>
>
> Due to the company network I am unable to access non "standard" ports due to
> the firewall.
>
> This has prevented me from connecting to CVS outside the buidling. As a work
> around I wondered if there was a CVS frontend available, or if it is planned
> anytime soon?
>
> At least then I could see what has been updated and maybe download it via
> that interface - like the PEAR project works.
A CVS frontend is just for browsing. It is not convinient for dowloading
the latest developments of of the project in a single archive.
I will look for the possibility of generating daily .tar.gz and .zip
archives that you may download via the Web.
--
Regards,
Manuel Lemos
Hello,
On 01/17/2003 03:29 PM, Steve Fisk wrote:
> Thanks for your correspondence - I feel a lot happier about the whole thing
> now - it has just taken a whole day of reading the manual, your replies and
> cms.component to get to grips with most things and why you use them where
> you do - two little things still have me a bit befuddled.
>
> Mike has verbally told me that you can have several components that talk to
> the same database provided every class within the component is in the same
> component as one it depends on or has to talk to. How do you set the create
> database option to only create one database and not one for every component?
Metastorage generates classes for creating or updating the database
schemas. You can run the installschema type function as many times as
you want. But on the first time, only the first class you call install
schema may actually create the database, so you have to set the variable
createdatabase to 0 for the other classes.
> Finally - I don't really understand how the addtocollection type function
> works - it might be because it's last thing on a Friday and my brain is
> fried but would you mind running over it with me and then I can get my
> thinking gear around it at some point on Monday?
Don't worry, software modelling is really abstract and so it requires a
lot of concentration.
addtocollection type functions are meant to add objects to a collection
of an object of a given class. For instance, in the cms.component
example, you have articles and categories of articles.
To add a article object to a given category object, there is the
addarticle function of the category class that is of type addtocollection.
So, at run time if you have an category object in variable $c and a
article object in variable $a, you just execute $c->addarticle($a) and,
assuming that it succeded, from them on the article in $a will belong to
the collection named articles of the category object in $c.
Since the articles collection of the categories class references a
member of the article class named categories that is also a collection
pointing back to the categories class, the category object in $c is also
implicitly added to the categories collection of the article object in $a.
This a many to many relationship. An article can be in many categories
and a category may have many articles. Although you should not be
concerned with the actual implementation, this kind of relationship is
implemented with an additional database table that contain references to
the objects of both classes that relate to each other via these
collections.
--
Regards,
Manuel Lemos
>>Is there a set of functions that you would recommend in each class and
>>some that are more specific to Factory? We are starting to understand
>>things a little better now – think we have figured out how the
>>collection tags work - but are still not sure which functions it is
>>important to have in each class and which in the factory class. Have
>>you got any suggestions to that effect or any more detailed examples
>>than cms.component that we could look at?
>
>
> It is actually very simple. Either the factory or the classes will only
> have the functions that you declare in the component definition.
>
> The factory will have functions that create object either from scratch
> or retrieving them from the database, like create a new object of this
> class or get me all objects of this class.
>
> The classes will have functions that to execute actions on objects that
> are already created like save this object to the database or get me all
> objects of some class collection that relate to this object.
Hello,
I have just made available a XML-RSS news feed to help keep tracking the
progress of the Metastorage progress.
This is a 3 in 1 file: ChangeLog, TODO list and NEWS feed that you can
grab with any RSS feed reader with one detail: feed readers will not
distinguish todo from done items. So, you would better keep an eye on
this page with a XML capable browser that highlights the done items to
distinguish them from the done items because I used special tags from
the XML-RSS progress that I created (although I have not yet documented).
http://www.meta-language.net/metastorage-progress.xml
As you may see, the latest developments include the ability to define
entity classes in separate files and also the availability of daily
snapshot archives of the CVS repository that are now available from the
download page for those that can't access the CVS repository for some
reason. The CVS repository also includes MetaL and Metabase that are
necessary to use Metastorage.
http://www.meta-language.net/download.html#snapshots
These are not major new features and so they are not yet announced in
the main site news feed. They will be announce in the next major release.
http://www.meta-language.net/news.xml
Stay tuned.
--
Regards,
Manuel Lemos
> -----Original Message-----
> From: Manuel Lemos [mailto:mlemos@...]
>
> As you may see, the latest developments include the ability to define
> entity classes in separate files and also the availability of daily
Brilliant :-) Thanks for the effort over the weekend!
> snapshot archives of the CVS repository that are now
> available from the
> download page for those that can't access the CVS repository for some
> reason. The CVS repository also includes MetaL and Metabase that are
> necessary to use Metastorage.
>
> http://www.meta-language.net/download.html#snapshots
Nice. Thankyou Manuel.
Regards,
Mike C
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Hi all?
I was wondering if anybody has bothered to work on a way of generating
default HTML form templates based on component class schemas - as a nice way
of getting simple admin screens knocked out ready for some input to be put
into the newly generated database by MetaStorage/MetaBase ?
The templates may (or should?) also contain the relevant code to bind the
HTML form fields with the MetaStorage class functions to enable getting
things running as quickly as possible after designing the XML schema.
Any suggestions or thoughts? It may be possible to alter an existing class
to work with MetaStorage...?
Bye,
--
Mike Carter [web developer]
tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com
This message is confidential.
Unless you are the named addressee or their delegated representative you may
not use, disclose, or copy the contents of the e-mail. If you are not the
named addressee please notify the sender immediately and delete the material
from your computer. Any views or opinions contained in this e-mail are
solely those of the author unless expressly stated otherwise
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Have got
4 classes in my component file – RecordEntry is
the first one I declare in the XML and I use it to declare a collection thus:
<collection>
<name>RecordEntries</name>
<class>RecordEntry</class>
<reference>Member</reference>
</collection>
Error:
it was specified a collection reference (Member) to non-existing class (RecordEntry) variable or collection for collection with the
name "RecordEntries"
(File
"medicalRecord.component", Line 131, Column
0, Byte 2037).
Unless you are the named addressee or their delegated representative you may
not use, disclose, or copy the contents of the e-mail.
If you are not the named addressee please notify the sender immediately and
delete the material from your computer.
Any views or opinions contained in this e-mail are solely those of the author
unless expressly stated otherwise
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Hello,
On 01/21/2003 01:01 PM, Steve Fisk wrote:
> Have got 4 classes in my component file – RecordEntry is the first one I
> declare in the XML and I use it to declare a collection thus:
>
> <collection>
> <name>RecordEntries</name>
> <class>RecordEntry</class>
> <reference>Member</reference>
> </collection>
>
>
>
> Error: it was specified a collection reference (Member) to non-existing
> class (RecordEntry) variable or collection for collection with the name
> "RecordEntries"
>
> (File "medicalRecord.component", Line 131, Column 0, Byte 2037).
>
>
>
> Anyone know what I’ve done wrong?
This means that there seems to be no variable or collection in the class
RecordEntry with the name Member. Keep in mind that all names are case
sensitive. So, Member is different than member.
--
Regards,
Manuel Lemos