Search found 19 matches: polymorphism

Return to advanced search

Re: hash for storing variables

... programming (OOP), especially regarding modularity and encapsulation. However, it lacks classical OOP elements like inheritance and polymorphism. The use of multiple levels of patchers and preprocessors for composing components resembles the OOP principle of composition. This enhances ...
by Otto
Tue Nov 28, 2023 8:40 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: hash for storing variables
Replies: 7
Views: 526

Re: Database - 17.07 - Problems

Antonio, It was me that requested the End() method. The reason was to conform to polymorphism with this class. Every other class has an End() method but TDatabase only had a Close() method. There is a new Procedure called TD_Destroy() that was also added in ver ...
by James Bott
Fri Sep 01, 2017 2:07 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Database - 17.07 - Problems
Replies: 84
Views: 11898

TDatabase End() method

... Yes, I know it has a Close() method, and that is consistent with the CLOSE statement. However, as an object, the Close() method name violates the polymorphism concept. Most of the other classes have an End() method. So if you just add this line: METHOD End() inline ::Close() We can then use oDBF:End() ...
by James Bott
Sat Jul 15, 2017 12:54 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: TDatabase End() method
Replies: 2
Views: 536

Example Business Object (Customer)

... business objects are the most important advance one can make in programming. As I have said before, the main concepts used in OOP are granularity, polymorphism, encapsulation, and inheritance. I am using all of these here. Inheritance: This class is inheriting from my TRecord class which inherits ...
by James Bott
Wed Jun 28, 2017 6:02 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Example Business Object (Customer)
Replies: 32
Views: 8531

Re: Tdata still Up to Date ?

... (the object) to get access to all the data and methods of the object. Encapsulation is one of the doctrines of OOP. Another doctrine of OOP is polymorphism (same naming). So it would be better to name the method "Print" and use the same name for other classes too. This way you can ...
by James Bott
Thu Jun 01, 2017 3:14 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Tdata still Up to Date ?
Replies: 25
Views: 5136

Re: XBrowse, how to turn on lines?

... should be the last statement after specifying all settings. Thanks. Obviously, I didn't know that. It is now in my notes. This is one reason that polymorphism (like naming) is important and useful in OOP. If the syntax for the browse was: DEFINE XBROWSE oBrw...ACTIVATE BROWSE oBrw Then there would ...
by James Bott
Thu Apr 28, 2016 4:23 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: XBrowse, how to turn on lines?
Replies: 24
Views: 4443

Re: xBrowse ERROR

... the database class already does this in it's Close method so you can just do this: oDBF:close() Actually, to be consistent with standard naming (polymorphism) it technically should be: oDBF:end() But our TDatabase class doesn't have an End() method so we have to use the Close() method. The advantage ...
by James Bott
Thu Mar 13, 2014 6:15 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: xBrowse ERROR
Replies: 14
Views: 2152

Re: TDataRow and ADO questions

It would seem that it would make sense to have a different class for each data source. Each class should follow polymorphism so each is syntax compatible. Then you just link-in the class you need. Making separate classes makes each one simpler, with less code, and easier to read ...
by James Bott
Tue Jun 11, 2013 7:05 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: TDataRow and ADO questions
Replies: 48
Views: 11549

Re: UP, DOWN arrow keys pressed in xBrowse

James,

thank you very much for this tip, how to use inheritance and subtyping, polymorphism or overriding. How easy OOP can be ;-)
by frose
Mon Nov 09, 2009 2:42 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: UP, DOWN arrow keys pressed in xBrowse
Replies: 19
Views: 3516

... we have and what to expect from it. So far I am getting the impression that you believe in OOP, but not in inheritance, encapsulation, or polymorphism. So, I am still left with my original impression that you don't really understand OOP. Regards, James
by James Bott
Wed Apr 16, 2008 6:47 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771

... have a TData class for DBF access, a TRecordset class for SQL recordset access, and a TArray class for array access. These all were written using polymorphism, so they all have the same methods and data. Any class can be substituted for the other so you can access data in all those formats. I ...
by James Bott
Mon Apr 14, 2008 11:54 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771

... dbfPATIENT ) Is there a reason you used Create() as your constructor method rather than the standard New()? This is a violation of the polymorphism principle. >This means that any class can access the currently selected patient, for example, without having to pass the patient object ...
by James Bott
Mon Apr 14, 2008 8:19 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771

... reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you ...
by James Bott
Mon Apr 14, 2008 12:01 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771

... reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you ...
by xProgrammer
Mon Apr 14, 2008 8:42 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771

... reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you ...
by James Bott
Thu Apr 10, 2008 8:48 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: A Question Abot DIALOGs
Replies: 45
Views: 12771
Next

Return to advanced search

cron