Jump to content

TMS Aurelius, LiveBinding, UniGUI, VCL/FMX


eelias

Recommended Posts

"Hi Eduardo, I am trying too with TMS Aurelius + Databinding + Dependency Injection (Spring4D) + VCL. I am trying to create some basic structure that allow me to increase the development time and in a future with uniGUI. But I really feel a little lost because I haven't see any reference. I'm just a begginner trying to grow up but it's not easy. So, I really will thank any help or oriantation about it."

 

I will give the answer in the public forum so others can have benefit of that. I got many help from others here also :)

 

Delphi is known for the RAD structure, that is: You put a button on a form, click on it and start writing code right there.

 

That is fantastic to create a prototype. No more than that!!! sure....

 

I have made several big projects with Delphi, and all those I made using this RAD stuff caused a lot of problem after some years. WHY? because you start doing COPY and PASTE of the code everywhere or moving to places that was not correct.

 

The fact is that RAD is not OOP oriented. And it is not Procedural oriented either... :) 

 

The better way now is to go OOP and using the RAD resources. 

 

For OOP I am using TMS Aurelius. There are other like mORMot and tiOPF that are FREE.

 

However TMS Aurelius is extremelly simple, since it is client side. mORMot is powerful, but it work with a different concept that is server side OOP repository. 

 

Aurelius permit that you create classes that will be persisted on a database. So you dont open a database and look for a table and a record.

 

You use your class. It is needed to follow the demos and read about how Aurelius work from their documentation it is not difficult, but it is different.

 

Right now It changed everything for my project: I dont have database oriented project anymore. I can use ANY SQL server that is available (the main ones) and dont care about this detail. 

 

There is no more fields references on the code anymore. That is terrible, since if you change the field name on the database you have no idea where in the code the field is. With an ORM (like Aurelius) you change your class, and during compilation you will know where the impact will be. And more than that. Based on class you can deal with details of the field. For example, in my country you change ZIP code like this: 99999-999, based on a class I can check the consistency of the data before it gets persisted. That is the same thing for any data, one place with all the intelligence.

 

The other thing is using a Framework for Layers. The best structure for Delphi to use with UNIGUI is MVP. 

 

Here is a simple example with no framework: http://www.danieleteti.it/category/programming/design-patterns/mvp/

 

There are other patterns, but I liked MVP more that the others:

 

1 - M : Model

  this is where you place the classes that deal with the entities. Entity is the class that will be persisted on the database. The model has the business model. It means that it keeps the intelligence to use the classes correctly. The Model is a class and you should have one for each main concept: TModelProduct, TModelCustomer.

 

  The TModelProduct will use and understand how to deal with TEntityProduct, TEntityStock, TEntityPrice for example... and keep them all correctly. When learning Aurelius for example, it will make more real this. But do not follow the examples of Aurelius !!! They choose MVC model that is hard to use on Delphi. Take a look on the examples and compare with the Link above of MVP.

 

2 - P: PRESENTER

 

  The presenter is a class that know how the model works and how the view works. This is the code from behind the Form. Everything that you put here, came from the Old RAD stuff, any button any event, anything that you used to create on a form is placed here. Doing that will make you create in a general way and the view can be changed.

 

3 - V: View

 

 The view: this is the form itself. My forms now are totally dumb, no code at all. Only drawing, components, and LiveBinding. LiveBinding is difficult at first time. I am still experimenting that on uniGUI. and if neded I will be using old DataSet style. AUrelius comes with a DataSet component that makes the magic and make the classes compatible with DB components. My Presenter asks the Aurelius manager for a cursor that can be assigned to the TAureliusDataset and it behave like a table. That is fantastic because you can change the Entity classes, that will reflect on the tables and keep everything working.

 

 

It is important to understand this structure based on the Danieli Teti example from the link.

 

The View SHOULD NEVER know about the presenter.

 

That is what Dependency Injection is all about. A pattern to how make things dependent of each other. Spring4D is one full featured framework for that. BUT if you learn design patterns you will understand that you can write that by yourself.

 

I told before that UNIGUI should be only for web. No VCL unigui components AT ALL, just for design time only and with no need to be 100% working at design time.

 

I believe Farshad should put all his efforts in make it everytime better on web. Right now it is good (there is no other real option) but it is TOO SIMPLE! and TOO SIMPLE on VCL either. So, the worst of both platforms, that is no GOOD!

 

Writing an application you should use the best of each platform.

 

IN a MVP pattern you can do that: you create your Mode, Presenter, both used in all the platforms. Same code. No references to platform specific things: Never use TUniPanels, TUniLabels, TLabels, TPanels or anything that is platform specificl. You can use low level classes, that is one thing good about UNIGUI since descend from the same classes that FMX and VCL. That low level classes are safe to be used.

 

But even better, look at the Daniele code and see how to be totally isolated. In uniGUI we need to use the grid that is available. But in VCL you can use TMS Grid or DevExpress GUI, MUCH BETTER ! However you can find a javascript GRID light years better and want to use it, if you use MVP pattern you can on the UNIGUI project use that and it will not cause problem on the other project.

 

The fact is that you need to draw a view for each platform.

 

My current platform have 3 views for each presenter:

 

- WEB: based on unigui: I use the components that unigui give me and I use javascript ones. I try to use the best possible, I dont  have the concert to make UNIGUI works on desktop, I am free!

- Desktop: I use FMX: it is a lot different, you need to learn LiveBindings, but in XE5 the bus are mostly fixed and they simplified the LiveBindings. FMX only if you have XE5, before that is hard with FMX then you should go VCL. Why FMX: I am using because I need to get ready for Apple and need to get experience for mobile.

- Mobile: I have a view for each one, one using DPF components for android, and other using DPF for IOS

 

There is need to do that, then you get the benefits of each platform keeping the intelligence of you code protected by the other layers.

 

It took me a lot of time learning and getting rid of the bad addiction of RAD.

 

It is important to read and practice this patterns also: http://delphipatterns.blog.com/

 

Eduardo

 

 

 

 

 

  • Upvote 4
Link to comment
Share on other sites

Farshad, I hope you take in a good way... 

 

I am missing a much better way to style things, from the perspective of a Delphi programmer. Since it is directed to a Delphi programmer...

 

Like the styles on VCL/FMX. I know there is CSS from the extjs, but again, I will be going to the other side and adding complexity to the project, but I prefer to a solution that could be maintained by a Delphi programmer in the Delphi side. Take a look on StyleBook of FMX as example, I dont want to rely on extjs templates/styles

 

For me it is not important DB components so much.. .since I am preferring to use LiveBindings. However if we could have more of the ExtJS properties implemented on the uniGUI components much better, to not rely on JS injection to control ExtJS. For example, transitions, animations, etc

 

 

I see that many applications are going to web, and they are using solutions that permit to write the web-style. Delphi desktop looking is not web-like and soon will be considered not acceptable for web.

 

This the menu and one of the many forms on the application running in uniGUI:

http://snag.gy/gM3My.jpg

http://snag.gy/XCznZ.jpg

 

I use animations and other effects to looks like more web than desktop application. I believe the result was not far from expected, but it took  me a lot of effort, writing a complete set of components and handling the colors.

 

In that that sense, reducing the difficulties to make more like web would be great!!!

 

Here is an excellent example: http://designmodo.github.io/Flat-UI/

 

Eventually I am not aware of some of the possibilities of UniGUI, however this Flat UI is an example of looking that is expected today. uniGUI is already doing a great job on the structural part. It is time to go to design part, and web is all about visual!

 

Thanks

 

Eduardo

Link to comment
Share on other sites

I see that many applications are going to web, and they are using solutions that permit to write the web-style. Delphi desktop looking is not web-like and soon will be considered not acceptable for web.

Sorry for interruption, but this is so wrong and subjective. What I see on your screenshots is just a mimic of MetroUI from Windows8. Needless to say it's design considered "questionable" to say the least, and that is objective and shared by millions of users.

If you are writing a web application to work with loads of data where users are supposed to peer at the screen for hours, the last thing you should add are colors and animations. And UniGUI is perfect for that - data crunching web applications.

You have chosen a wrong library for your needs and now want to turn it into something else. I suppose that upcoming UniGUI Sencha Touch framework is what you are actually looking for.

Link to comment
Share on other sites

Zilav,

 

Like you said it is subjective. 

 

I can tell you that there also millions of users that like MetroUI also. And for Line of Business application it is extremely good visual. For other uses I don't like either. 

 

My interface are not just panels with colors, but they are animated, those tiles have movement. And overall application try to mimic other metroUI style.

 

Sorry to tell  you but each time more windows 3.1 Delphi 1 looking applications will be less and less used. Are you going to hold this position and be one of the last programmers to move to better looking applications?

 

UniGUI is a great tool, and I like it and adopted it because it is stable flexible. But just said that from interface perspective it is simple, there is nothing wrong on saying that. If you ask anyone here you will see that the more elaborated interfaces you need a lot of panel etc. Eventually this is the only and correct way and I am asking too much... I am sorry for that. But I believe we could have more things on the Delphi side and do depend on JS injection. 

 

I want to see uniGUI each time better.

 

Thanks for your comment. My reason of the post was to comment about the n-tier strategy that I was asked.

Link to comment
Share on other sites

  • Administrators

Farshad, I hope you take in a good way... 

 

I am missing a much better way to style things, from the perspective of a Delphi programmer. Since it is directed to a Delphi programmer...

 

Like the styles on VCL/FMX. I know there is CSS from the extjs, but again, I will be going to the other side and adding complexity to the project, but I prefer to a solution that could be maintained by a Delphi programmer in the Delphi side. Take a look on StyleBook of FMX as example, I dont want to rely on extjs templates/styles

 

 

 

Personally, I don't give much importance to styles and visual looks. IMO, the end users even care less about the look and what they want is functionality. I believe that Ext JS provides best user experience for both style and functionality.

 

 

 

 

 

For me it is not important DB components so much.. .since I am preferring to use LiveBindings. However if we could have more of the ExtJS properties implemented on the uniGUI components much better, to not rely on JS injection to control ExtJS. For example, transitions, animations, etc

 

 

 

 

On the contrary for many other users DB controls are a must. OTOH, I agree that using LiveBindings is a clever way of designing your UI, but for average Delphi developers DB controls are very important.

 

 

 

 

 

I see that many applications are going to web, and they are using solutions that permit to write the web-style. Delphi desktop looking is not web-like and soon will be considered not acceptable for web.

 

This the menu and one of the many forms on the application running in uniGUI:

http://snag.gy/gM3My.jpg

http://snag.gy/XCznZ.jpg

 

I use animations and other effects to looks like more web than desktop application. I believe the result was not far from expected, but it took  me a lot of effort, writing a complete set of components and handling the colors.

 

In that that sense, reducing the difficulties to make more like web would be great!!!

 

Here is an excellent example: http://designmodo.github.io/Flat-UI/

 

Eventually I am not aware of some of the possibilities of UniGUI, however this Flat UI is an example of looking that is expected today. uniGUI is already doing a great job on the structural part. It is time to go to design part, and web is all about visual!

 

 

 

 

All these new UI stuff are designed for Touch oriented devices. The classic UI is the most productive UI in my opinion. Ext JS 5 will bring support for  touch oriented UI so I think with Ext JS 5 and uniGUI support for it many of your requests will be fulfilled.

 

Again, I must emphasis that the classic Windows 3.1 style UI is the most productive GUI for people who actually use keyboard and mouse, and need to input heavy amount of data daily..

 

 

 

Thanks

 

Eduardo

Link to comment
Share on other sites

  • Administrators

Sorry to tell  you but each time more windows 3.1 Delphi 1 looking applications will be less and less used. Are you going to hold this position and be one of the last programmers to move to better looking applications?

 

Better looking apps are not necessarily  functioning better or faster. Many of those better looking apps are not intuitive for end-users.

Link to comment
Share on other sites

Personally, I don't give much importance to styles and visual looks. IMO, the end users even care less about the look and what they want is functionality. I believe that Ext JS provides best user experience for both style and functionality.

 

 

 

Well, according some researches this is programmers opinion, not the end user opinion. Sure at the end of the day the user needs its work done, and that case visual is not the main importance. BUT I just got a chain of stores to use my software because I have exactly the best of both worlds... I use advanced flat interface and intuitive data entry keyboard enabled...  the software that they use and is changing by mine is actually a old looking windows 3.1 style... so based on my experience I cannot agree with you.

 

What I see is that a lot of lazy programmers do not invest in doing better. There is need to study and invest time in doing better.

 

 

 

On the contrary for many other users DB controls are a must. OTOH, I agree that using LiveBindings is a clever way of designing your UI, but for average Delphi developers DB controls are very important.

 

Sure! I like those DB controls, but those are not my focus... nothing against it.... just preference... I wish uniGUI can work both ways

 

All these new UI stuff are designed for Touch oriented devices. The classic UI is the most productive UI in my opinion. Ext JS 5 will bring support for  touch oriented UI so I think with Ext JS 5 and uniGUI support for it many of your requests will be fulfilled.

 

Again, I must emphasis that the classic Windows 3.1 style UI is the most productive GUI for people who actually use keyboard and mouse, and need to input heavy amount of data daily..

 

 

Like I said, this is not that many are saying and going... actually we are each time more distant of this kind of interface.

 

We are going to a multi platform world were web will definitely play the main role and native cross platform applications. Touch will be more and more used, but new metro like applications does not mean that you cannot use it for heavy data entry.

 

Good to know that extjs 5 will have all that... hope to get hands on that soon !!

 

I have some concern on this style thing, and I believe that uniGUI needs to be flexible to go both ways, this was my intention. On Microsoft C# world you have those options, you can be extremely simple or be more elaborate. 

 

It is fantastic that UniGUI permit to have JS injection! than it let me do more things that was not in the scope. I just suggested to have more integration with extjs, not today, but across the versions...

Link to comment
Share on other sites

Better looking apps are not necessarily  functioning better or faster. Many of those better looking apps are not intuitive for end-users.

 

The app that function better is the one that was correct designed. I know thousands of old looking bad designed application either... and new ones... I just cannot advocate that just because is the old style is better. No it is not. Based on that concept DOS like applications are much better. In very few situations I could agree with that, but that was because BAD design. And after 25 years of experience with pascal, and since delphi 1 I see programmers that only want to deliver fast and with no care about the result, in that case the old style helps a little on the data entry, nothing else....

 

however, keep the good work, I am fully supportive to your tool and want to be extensively supporting it, just keep an eye on the future ;)

 

Eduardo

Link to comment
Share on other sites

"Hi Eduardo, I am trying too with TMS Aurelius + Databinding + Dependency Injection (Spring4D) + VCL. I am trying to create some basic structure that allow me to increase the development time and in a future with uniGUI. But I really feel a little lost because I haven't see any reference. I'm just a begginner trying to grow up but it's not easy. So, I really will thank any help or oriantation about it."

 

I will give the answer in the public forum so others can have benefit of that. I got many help from others here also :)

 

Delphi is known for the RAD structure, that is: You put a button on a form, click on it and start writing code right there.

 

thank you very much for your detailed explanation.

 

I also agree that in some business users expect a "nice" interface, but in other business they don`t.  F.e. in the account department a VCL looking interface is ok, but when showing customers an application on the IPad or on a presentation screen in a sales process they expect something as in your screenshot, more web looking. There we need to build our own interface, our own buttons, our own menu, and so own. Its a bit of work, but with the help of some topics here in the forum, the demo projects of UniGUI and many hours one can handle it.  -_- 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Bresler, Sorry, I am very busy here, I am writing my project based on Firemonkey and next week I will be going to UniGUI with it.... then I will see all the sort of structural problems with my code and issues to adapt. I am doing everything based on live bingind and hope that will work on uniGUI, Anyways I can mix DataSource based on UniGUI if needed. I let you know the result of that. Right now I cant!!!

Link to comment
Share on other sites

Hi guys, I already implemented the example posted by Zigzig and works. It is about an object than inherit from TUniEdit and is Livebindings enabled. 

 

Bresler, so it worked? That is good...

 

Did you test in other components or just with TUniEdit?

Link to comment
Share on other sites

Thanks in let us know....

 

I took a look and are similar. I am already fully connected to the Aurelius one. 

 

There are also the fact that Aurelius connect to RemoteDB and XData Server from TMS, and it aggregates a lot of other possibilities.

Link to comment
Share on other sites

Hi guys, I ony tested it in TUniEdit. I think to test it in other similar components. But these components aren't the most important (I think). The most imortant component is the StringGrid, but it is too complex to understant. In fact, I didn't see any example about to make a component like StringGrid Livebinding-enabled. So any help about it will be appreciated.

 

Thanks...

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...