Recent

Author Topic: Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid  (Read 8064 times)

rc.1990

  • Jr. Member
  • **
  • Posts: 54
Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
« on: September 24, 2013, 08:36:03 pm »
Where can I find articles or tutorials or books about Lazarus and OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid ?

jwdietrich

  • Hero Member
  • *****
  • Posts: 1278
    • formatio reticularis
Re: Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
« Reply #1 on: September 24, 2013, 08:55:16 pm »
It depends on your requirements.

As an introduction to both OOP and Lazarus / Free Pascal I recommend Howard Page-Clark's book "Learn to Program using Lazarus". A comprehensive reference is the book "Lazarus - the complete guide", but you should have basic knowlegde in programming.

There is a lot of other books on Lazarus and FPC, some of them are also an introduction to programming like Howard Page-Clark's book. You might want to check the titles in Open Library's Free Pascal section.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 4.2.0 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

rc.1990

  • Jr. Member
  • **
  • Posts: 54
Re: Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
« Reply #2 on: September 24, 2013, 09:23:55 pm »
I have used to work with Delphi 7 for long years.
I have succesfully migrated a Delphi 7 dataware project with Firebird to Lazarus 1.0.
Now I want to migrate that Lazarus 1.0 dataware project to Lazarus OOP respecting design patterns such as DAO, MVC, MVP, MVVM or MGM.
But I still need editable dbgrids on this project, maybe using OleVariant on datasets to achieve that purpose.

Many forums and blogs talk about DAO, MVC, MVP, MVVM and MGM but I do not find a complete and simple example implemented in Delphi or Lazarus using database.
They talk, but do not show how to do it.

If possible, I am searching for an example (article, tutorial or book)) with half dozen SQL tables and half dozen Delphi or Lazarus screens so I can learn from something near my desired daily reality.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1278
    • formatio reticularis
Re: Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
« Reply #3 on: September 24, 2013, 09:28:34 pm »
Under this premise "Lazarus - the complete guide" may be most appropriate for your requirements. However, you will also need some additional references, first of all the tutorials on databases in the Free Pascal wiki.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 4.2.0 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

Graeme

  • Hero Member
  • *****
  • Posts: 1526
    • Graeme on the web
Re: Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
« Reply #4 on: September 27, 2013, 08:03:51 am »
Now I want to migrate that Lazarus 1.0 dataware project to Lazarus OOP respecting design patterns such as DAO, MVC, MVP, MVVM or MGM.
But I still need editable dbgrids on this project, maybe using OleVariant on datasets to achieve that purpose.
As my other reply mentions... Definitely take a look at tiOPF [http://www.tiopf.com]. Get the latest source code from SourceForge and use the tiOPF2 branch (which is the one for use with Free Pascal). tiOPF has been around since before 1999, and is probably the oldest and most mature OPF framework for the Object Pascal language. It is very well designed, uses many design patterns, and has a very feature complete MGM implementation that support 3 GUI toolkits. All my commercial Delphi/FPC projects are based on tiOPF, and it works wonderful.

These wiki instructions should get you going with FPC+Lazarus+tiOPF:
  http://wiki.freepascal.org/tiOPF
« Last Edit: September 27, 2013, 08:22:29 am by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018