For a thesis ??
Posted by seybaa 28.09.2004 17:34Hello as i have mentionned i stidy computerscience at univeristy,
I am really impressed by DaoGen that I want to know if i want to try to do something like it, do you have some designs or doc that i could used as source of inspiration ? that is why I was interrested in download it, but i after I have read the FA i understood that, that is ont posible.
I very much like to understood the procees of autogenerating source from db.
you are magic man.
Re: For a thesis ??
Posted by Luigi 28.09.2004 20:26OK, now I understand. Unfortunately I can not give you any description or design document because I have none. Let me explain the short(?) history of DaoGen and you will understand why.
For a long time I have been interested about CMS (Content Management System) for websites. Something like 4-5 years ago, I started programming an experimental CMS to test some theories and ideas that I had. I started the original programming using PHP language and I did write quite a lot of code, mostly SQL database handling code for this project.
Finally, my CMS project (later named as FastCMS) needed some re-organizing and at the same time I decided to swith from PHP to Java language. Then I realized that I would loose the years of work that I had spent on writing the SQL code using PHP and I though that I can never finish the project (FastCMS) if I will have to write all that code again.
I have always wanted to program my own solutions for problems that I face, so I decided that I will make a tool that will do the SQL programming for me. I wanted that the resulting tool would make high quality code, which I could customize to fit any purpose. So I started the DaoGen project. The first versions of DaoGen were done with PHP, so I made the same language-choice mistake again (later I had to re-implement the DaoGen with Java) but the result was good enough that I was able to generate the DAO layer for my new CMS system.
So as you can see, I had no particular design or spesification in my mind, I just started experimenting on how I could solve a spesific problem and eventually the result was good enough that I decided to publish it in the net. For the later versions I started considering other people's needs and the possibility to use the generator for the projects that I do at work, but the reason why DaoGen is like it now is, comes from the fact that originally I just needed a tool for myself.
Also I hope you will understand that because of this history, I do not have much time for developing the DaoGen further. My main project is still the FastCMS system, (which you are using right now because TitanicLinux.Net runs on that platform) and DaoGen does all what I need for that project.
For your own generator, I can explain this simplified principle that is applied in DaoGen:
The current DaoGen is programmed around the idea of meta-data. Meta-Data is a set of data, that describes something, in this case that something is a SQL table. You should first build a model, which contains all needed information about any given SQL table, and then implement some way to create this meta-data set (read from the database or from XML for example).
Once you have the meta-data, you should think about what kind of code you want to produce. Maybe you want to make the value-object class and DAO class, so you should think of what methods are needed and how they should work. Then you program a samples of these classes.
Now you have the meta-data and sample classes. All you need to do, is to make the example classes to be templates, which are filled using the data from the meta-data set. And now you have the generator.
If you proceed with your own project, I would be interested to hear more about it.
Re: Re: For a thesis ??
Posted by seybaa 29.09.2004 11:53thanks a lot for you time, i compile the information I have got.
to me it is like a set of high level of framework of the idea about how to do the generator.
A abstract direction.