Welcome Guest, Not a member yet? Register   Sign In
Trying to use propel as model generator
#1

[eluser]Unknown[/eluser]
Hi out there,

I was wondering, why nobody ever tried to integrate the Propel-Framework for generating a model. So I will begin, doing it by myself. I also opened a Wiki-Page for documenting the progress of my work.

Any suggestions and help are welcome Wink Since propel does not generated direct usable CodeIgniter model classes it would be interesting, how to change the templates or otherwise, how to add an generation of an CodeIgniter model class which uses the standard propel class files.

There are different pro and contras to use the standard generated propel class files. The most interesting Pro: You can use generated Classes from other frameworks using propel (like Symfony) without any changes. Otherwise, if you have a schema.xml, it's peace of cake to generate new classes.

so... I think this will be enough to start discussion.

best regards
Daniel
#2

[eluser]David.M[/eluser]
[quote author="kille77" date="1183937363"]Any suggestions and help are welcome Wink[/quote]

Hi, this is a great idea. I really like the codeigniter framework, and propel, and am glad someone is trying this.

Please let me know if I can help.

David
#3

[eluser]Unknown[/eluser]
sorry, had to reinstall my computer. I will work on that next 2 weeks Smile then I'll let you know, how far I'm.

Best regards
Daniel
#4

[eluser]marcoss[/eluser]
I hate Propel and the like, having to use an schema.xml to build an schema is ridiculous, besides it just makes the whole development process complex and provides no real benefits, not to mention that for the "regular" programmer is a pain in the ass to install and it requires Phing, which is not available in shared hosting.
#5

[eluser]David.M[/eluser]
[quote author="marcoss" date="1184778171"]I hate Propel and the like, having to use an schema.xml to build an schema is ridiculous, besides it just makes the whole development process complex and provides no real benefits[/quote]

It looks like you have never had to create and maintain a large database with relation/foreign keys, that is the real pain.

The good thing about propel is that you can create all of the relation via the xml and then when you generate the sql and models it checks to make sure all of your relationships are correct.

Trust be that was a big help when designing my database with 90+ tables and many foreign key relations per table. Not only that but I get all of my database models with complete relation functions all in the same build. Also if you schema changes you can just rebuild the models from the xml and update the controllers vs having to change all of the models manually and controllers.

About the shared hosting, you do not need to install phing on the web server. You can just run it from your workstation, which is only needed when you build everything. I might be wrong about this as I have never install it without pear, but I think you can install propel/creole manually.

He is not saying you have to use it, he is just trying to help out the ones that want to.

Hope this helps a little.

-David
#6

[eluser]esra[/eluser]
If you're using MySQL, have you guys ever considered using DbDesigner from Fabforce?

http://fabforce.net/dbdesigner4/downloads.php

DbDesigner is similar to Rational Rose. It allows you to create a schema model using a UML approach. You create your tables, can assign relationships, can assign foreign key constraints, can manage your inserts, etc. The application is GPL with versions available for Windows and Linux. It can also reverse engineer and existing database to create a model, and provides a synchronization feature for keeping your database and model design in parallel. The application supports plugins, so its extensible.
#7

[eluser]marcoss[/eluser]
[quote author="CI DavidM" date="1184793100"]
He is not saying you have to use it, he is just trying to help out the ones that want to.
[/quote]

I still find it useless and believe that with a proper database design you don`t need it, in fact i have an application with 42 tables using complex relationships and every time some of them changes i just extend the "core" model to handle backwards relations into the new schema, no more than 2 hours of code to make it work Wink

But as you said, i don't have to use it, just trying to set my point of view, every contribution is always welcomed.
#8

[eluser]David.M[/eluser]
[quote author="marcoss" date="1184800647"]I still find it useless and believe that with a proper database design you don`t need it, in fact i have an application with 42 tables using complex relationships and every time some of them changes i just extend the "core" model to handle backwards relations into the new schema[/quote]

I totally agree with you! I am still semi new to the MVC approach.

I am currently just using Active Record to migrate my current project over to code igniter. I like Active Record alot! I have used propel before and I prefer the Active Record style. I just wish there was a way to get the basic db models created for all the tables that would be compatable with CI.

How do you design your databases?

Extending the core model sounds very interesting, do you mind posting an example? I am curious how that is done. =)

Thanks Marcoss!
#9

[eluser]Crafter[/eluser]
Quote:am currently just using Active Record to migrate my current project over to code igniter. I like Active Record alot! I have used propel before and I prefer the Active Record style. I just wish there was a way to get the basic db models created for all the tables that would be compatable with CI.

Look at the Open source CodeCrafter project (link in my sig).
#10

[eluser]marcoss[/eluser]
[quote author="CI DavidM" date="1184808106"]How do you design your databases?

Extending the core model sounds very interesting, do you mind posting an example? I am curious how that is done. =)

Thanks Marcoss![/quote]

Database design is just too personal to be standardized, i have a method that work pretty well for me and is wicked fast.

I separate "objects" from it's properties, then each group of properties gets it's own table linked to the object_id, so i get a similar approach to the one used by Propel, but faster.

Then as the application gets more complex, you can add more layers, for instance you may need a high level hierarchical organization of your objects.

Regarding the "Core Model", it is like an interface class, it has predefined methods and members that i can extend to create new relationships.

A good basic example could be found here, http://ellislab.com/forums/viewthread/55951/#274942




Theme © iAndrew 2016 - Forum software by © MyBB