 Welcome everybody! I want to introduce myself first. My name is Lars from Hotspihetto and I'm a developer at a small company in Hamburg. We used to use the object and EOF. I'm not a cruiser actually, but this stuff is very similar. So I'm excited to show you how to build a cruiser application. It's a database application using Gorm, DBModular and ProjectZilla. At first, I want to show you a small database application I hacked together in the days before. It's called the developer manager and I already prepared it. Usually you would open it by double clicking on the app folder, but we are in Ubuntu. There is no native support for cruiser in it, so you have to go to the binary itself. And I'm using Ubuntu because I want to show you that you don't need to switch to cruiser at all. If you want to use it, you can. It's a much better environment, but people mostly are thrown away by the interface. It's a little bit outdated nowadays, but it fits pretty well into the interface. Besides the menus, it's the menu of the application. The app is usually here. This is currently the work time. In future versions, you will have the application that fits in your environment perfectly well. So I want to show you this application. First, the idea to Windows. The intention of the application is just to read a mock-up or demonstration of a small app that you can use to organize your developers in the project with tasks. And I already put some stuff into the database. I can fetch it now. And here are some developers, some projects, and these are tasks that are assigned to those developers. I can now choose one developer, Nikola for instance, and say we should get a task assigned. Nikola, which task do you have assigned? And I can type in here. I hope I get it spelling right. And this is the new step project. All the stuff stays in the unzipped state at first, and I have to hit save to make it persistent in the database. Now I can quit the application, restart it, fetch the developers again, and voila! Nikola has built his task site. And to show you that it's not just somewhere inside the application, I opened the database with pg-admin. And you can see, this is the database. Here are tables, and if you look into these tables, you will see all those entries. You open the task table, and you see all the tasks aligned. It's usually made in the database, it's built over several tables, and you have to join those tables by the IE's, where the basics come. While this is good for the database, it's also good for working with it, because of that you want to make your own interfaces for the database, your own applications. So, that's it for this small application now. Now I'm asking you, can you guess how many lines of code I wrote for this application? Thank you. It's written outside. It's written outside, you can see the line of code I wrote. And now I want to show you how to build such an application. With all the tools I mentioned, at first we needed data model. And for that I'm not tricking you into leaving this without code and doing some magic stuff. I'm asking you two ideas for what about the database application should be. So, what kind of database and what we implement of kind of application? Any ideas? Gorm? We can't even invent gorm, is it? We need some entities like, for instance, a landing library, folks. An entity or a table, we can just name it. And we want, in the library we also want to have some users. Readers. Each one covers a book. Okay, now we need to find out what in what relation those entities are. Obviously, a reader can invent many books. Up to three books, for example. Let's say just many. Don't make it too complicated. Okay. My relation first. And one reader can have many books. One book can actually be only read by one reader. So, this is one to many relation. This is rather simple. And maybe add some additional stuff to make it a little bit more advanced. But I don't know actually, I have no idea how the timing is. And maybe start with this first and add additional features later. So, I'll show you now how to create a data model. For that purpose, we need to make use of the Civil Modular application. If you use 2.0, then you can install some of the stuff I'm using now. Actually, all of them in here. But those versions that are available at 0.2 are a little bit bug-rated. They are a little bit outdated. You know, DBM is the base of equal to everything that goes a little bit slow. So, I installed the stuff from 0.2, but installed over all this, the latest version from SVN, where some bugs were fixed. And so, we can use it now. And maybe you'll be surprised if you want to do it yourself and you install this stuff which comes out of the box from where you put it. It may not work, really. So, now, DBM Modular. This is an application to map database tables to objects. It's essentially the same like what Ember did with Entity, not every other AO Modular. And the AO Modular was a modeling application for the AOF. The AOF is the end-of-class object framework. Very budget name, but very good application, very good framework nevertheless. And let's start now. Wait a moment. I prepared a setup for all what we're doing now. And there's a couple of help files we need. And I have made a template for this, which I'll create a copy now. And we will call this application librarian, maybe. Bookshelf. Bookshelf. Now I get this template copied, which contains several files we need. There's all this stuff that the application builder needs later. Actually, here is some code inside. We have a file, some controller files, and everything else. It's still named like it was in the template. I rename this now. Now everything inside here got renamed. This is just a little shell script, nothing special. And we are ready to build the application. Back to DB Modular. There's already an empty model inside the application template. I've opened this now. We need better shooters for a new step. This file is called Bookshelf. We owe model B, where the little D stands for directory, because it's not actually a file, it's a bundle. Contains all this stuff to map the object data to the database in the end. Now we got an empty, the owe model. And we want to print at entities first. The name? The first entity was... Woops! Woops! Did it crash? I can't see it anymore. It must have been crashed. No, edit. Just click away for it. What? Just click off to break in the past. Excellent. And the icon is gone. Edit data. No, no, no, there's still to see the data list. It's three. It's crashed. And show effect. Now we have an entity here. Two entities actually. Called books. And actually we better take a single object form, reload and book. Because it's models. One entity. Here are several other columns. You can define a class which you want to use. And now resort to the original record. Because we don't want to do any special stuff you could do in a special defined class. But we need it now. Now here are our entities. First I give it a database name. The external name is the name for the table in the database later on. And it's better to use lower case naming here because I found there are some problems with the adapter to create a database otherwise. Okay. And when we try to save it now we get a checking, which tells us several things that are still missing. For instance here, which is the primary key for both entities is missing. It wouldn't make a good figure in the database without keys. If it's never the last word, we need what to do. So we now add attributes. And the first attribute is preferably the ID column name. Choose the same ID. And we wanted to have a number. This is a class from an open step or a new step which is used to implement number values. An external type is what's in the database and we choose here in 8 because we wanted to allow for really a lot of books. Then we add an attribute. Wait, first. We make this first attribute at the primary key and we lock it so that means if you change this attribute you have changed it basically. The first attribute of the book is the title. This will be an NS string, a class which can hold string values and the external type will be a variable character. And we make it quite long. Let's say 255 bytes since sometimes it's wrong. And we want to attribute it inside the class visible. This column, if you click the little diamond you will make sure that you can see it in the class object layer, the object layer. The ID is invisible. We don't want to mess with it. And GTA 2 takes completely control of it. So with other PHP or whatever who handles around these IDs we don't care for that stuff. We are object oriented. And the third column is whether it's allowed to have the entry whether it's empty or not. If I click it, it's allowed to have a book without a title. If it makes sense, no idea. But it helps later if you enter data that you don't need to enter everything at the beginning. And then we want another attribute. Let's say that's the author. The author names are not that long. It takes 63 characters. Then we read them. Hopefully you will see how views, obviously also needs an ID. And we will have a first name and a last name. It's just enough for now. Another customly American English keyboard. That's all the attributes we need. We save it now. There are no problems so far. But all about relational databases all about relations. And so we need to model a relation from reader to book. Since a book can be read by just one reader but every reader can have many books we need to add a foreign key in the book and the key. And this is called an ID. It means foreign ID. And it needs to have the same size as the ID in the book entity, of course. So we can join it. This will not be visible. It will not allow a... Okay, we can have books that are not landed currently but I just leave it out for the purpose now. Or maybe I don't know. I leave it to another person, okay? And now we are going to join those two entities. For that purpose we are going to... I'm sorry, reader for the mistake. For that purpose we have a relationship and since relationships are not that easy to render here we have an inspector for that purpose. We could have used it before but everything was at the time. And we call that relationship reader. We want to have it enabled and we go to the inspector and now we join the entity reader and we take the source attribute. We are going... We are very coming from the reader FID and the destination that we will achieve is the idea of the reader connected. And now we are doing the same for the reader to have a reverse relationship and this we call books because many books are available and this goes again from the ID to the reader FID and say to many connected. Now we can have a look at what we have done in diagram editor and we can see that one looks similar to what we did here. It's already swapped around. You can use that to get a better impression of what all this is in the model so I don't know if it's useful for editing and I've tried it in a modeler you can use anything big to do it in here and it doesn't work the best way. So now we got everything in our model what we need. Now we need to create the appropriate database for it and for that purpose we get a generate SQL button here but we need to first say which kind of database we want and I'm choosing a Postgres SQL because I like it and because it's a really cool database I've never used it but we're not this way and outside nice guys outside yeah they got a poster the password here is Knustab the host is the local host the port is usually any database s book shelf I had some troubles while creating databases using this adapter and in the end I realized you have to write a database name in a lowercase otherwise you get some troubles maybe it's a bug your modeler doesn't matter it has to be lowercase now you can generate SQL and it's a great database executers and can now have a look into PgAdmin show effect but if this doesn't work we can also save the stuff as an SQL file somewhere and do it manually it's the workaround that always helps I don't know why it's not working yet now it should work I hope fully we can create tables and stuff like the way it's supposed to be and check here several features you want to have create tables if you already got tables then you want some tables out you can say drop tables and you see all the SQLs generally right here and I hope it works now sometimes it locks the databases when I'm still in there in PgAdmin you have tables not good show effect whatever I do it in the traditional way we just show us how to make an application out of this with the other example I guess you all know how to create tables okay, but we already done right almost done right now but we need a database otherwise we can't sure but you can use the other example because the database can be there and all things everything is done then here that's man I'm blind and worked fine now we got our tables in here I think I didn't need to show it two tables whatever so now comes the interface part for that purpose I go into another application which is called for clue step object relation modeler it's basically a clone of the interface builder for next level and I open the prepared interface model file now such interface model file consists out of serialized objects which are deserialized at runtime and connected with proxies with the actual code we now need a window for two windows actually you can easily create them by track and talking those windows out here we got a window and inside that window we need our interface elements to make those objects to show them to show those objects this is an NS table view which models just a table and we have several columns inside and we will bind each column to something out of the database first I need to resize this stuff a little bit due to bug it doesn't work correctly and I leave out all the additional stuff to refine the interface I just leave out table titles and so on to be a little bit faster now we need some button which will trigger the action to actually patch readers first some button to add a reader and some button to remove one and now comes the interesting part now we see an interaction of those both applications and I'm now going to track some entity over here into the form model one is this that's what you could have done I did save it, I did not recent things better to set that up again and this table view now I save this I can use it again maybe this was the case no it shouldn't maybe in one version of the model you have an old template but the only template might be old so now we're going to wire this all up and I just track the book inside here and what we've got now is an editing context the steps for editing context and this is a simple example of book entity and editing context is something like a transaction you can use this editing context to make your changes editing and if you don't use it, you save editing context save and that's what it is now we have all those columns here and we now wire up the columns with the right attributes of the entity for that purpose you click into your column highlight it and track with the control key clicked onto the book entity and then you choose in the inspector you have EU column registration and wired up for instance with the title connected and the other one with the auto and our buttons first button we connect also to the book and here we say target is the action what is fired when you click the button is fetch it works makes that this button fetches all the books in the database for the other buttons we need to connect also to the book entity but we need different actions for an art it needs to invoke insert and for the remove it needs to invoke delete so now we need a save menu entry and for that purpose we got the main menu here the menu of the application itself and here we add the menu item which does the saving and we will wire this up with the editing context and they save changes connect now we have a state that we actually can try what we have done it should already work for that purpose yes, thanks for the hint for that purpose we use the third application of two step, the project center project center is mainly the EDE of two step and we use it just to build our application the icons down here should align by itself automatically works in window maker but in the video manager form suddenly you can do that whatever you open the project build pin build everything and now we launch pin launch it we don't see our window because I know it is you can now add some book written by Ricardo recommendation is it still correct it is ok what is it and then another book you will then write another one for me now that is the book that is the book which kind of book you want to have for development if you save this create the application re-launch it and the page books a critical error of course what is that I missed the password in the adapter this is the case because because all the stuff did not work at least it could give me a hint what I did wrong backlit and there should also be nothing in the database because if the password was wrong show effect if I sound like the pen for the work I had some troubles but not that kind of trouble password location is here but I didn't care to do that I think you saw what I wanted to do everybody has gone now and cleaned the room yes maybe I have to learn a little bit more about presenting it's a lot of time for this well it's a little matter of luck that's it for now it was my first time for the presentation I can only learn thanks