[fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?
silvioprog at gmail.com
Fri Jul 17 16:40:22 CEST 2015
On Fri, Jul 17, 2015 at 11:24 AM, Graeme Geldenhuys <
mailinglists at geldenhuys.co.uk> wrote:
> On 2015-07-17 15:08, silvioprog wrote:
> > Using the generics I could do a generic
> > DAO that could be used by any class, avoiding TPersonDAO, TProductDAO,
> > TOtherMyEntityDAO and providing a simple and useful CRUD layer: just
> I fully appreciate that there could be some uses, but I don't agree it
> makes the language any better - in the contrary, it makes it much harder
> to read. Pascal used to pride itself by being an easy to read and
> understand language [by a human].
I agree with Michael too, but a nice thing to allow other programmers to
make new libraries could be adding new features in the language, making it
more productive. I'm working in a new lib and I'm having several problems
to keep compatibility betten FPC and Delphi, so I'm using a lot of IFDEFs,
even using mode delphi.
As for you DAO example. It comes down to what Michael said - more
> frameworks need to be created. eg: I use the tiOPF framework for all
> data persistence and more. I can simply call MyPerson.Save or
> MyProduct.Save and the framework takes care of everything for me (CRUD,
> transactions, object ID's etc). I can even switch between database
> systems, database components or even to a 3-tier system without changing
> a single line of code in my software. Simply change a compiler define in
> the Project Settings and recompile my project. All without generics. ;-)
Me too, in any universe (Delphi/ObjFPC, Java, JS, PHP, TypeScript, C# ...)
that I'm working currenctly. =)
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal