Design patterns for (x)harbour

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

Post Reply
User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Design patterns for (x)harbour

Post by santy » Thu Dec 27, 2012 3:25 pm

Hi all,

Repeating design patterns I decided to create examples of their implementation for (x)Harbour.
First two patterns.

Facade pattern:
http://code.google.com/p/santysoft/down ... akechanges

Mediator pattern:
http://code.google.com/p/santysoft/down ... akechanges

to be continued. :)
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Post by santy » Fri Dec 28, 2012 2:36 pm

Singleton pattern:
http://code.google.com/p/santysoft/down ... akechanges

to be continued.
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Post by santy » Sat Dec 29, 2012 11:15 am

Builder pattern
http://code.google.com/p/santysoft/down ... akechanges

Two simple example using this pattern (in archive):

Computer builder and Report Builder. :)


to be continued.
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Post by santy » Thu Jan 03, 2013 9:41 am

Template method pattern
Intent. Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure

http://code.google.com/p/santysoft/down ... akechanges


to be continued.
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Post by santy » Fri Jan 11, 2013 1:32 pm

Decorator pattern
Intent. Attach additional responsibilities to an object dynamically. Decorators provide a flexible
alternative to subclassing for extending functionality.

http://code.google.com/p/santysoft/down ... akechanges

Factory Method pattern
Intent. Define an interface for creating an object, but let subclasses decide which class to
instantiate. Factory Method lets a class defer instantiation to subclasses.

http://code.google.com/p/santysoft/down ... akechanges
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
santy
Posts: 60
Joined: Tue Sep 25, 2012 11:19 am
Location: Ukraine, Lviv
Contact:

Post by santy » Tue Mar 05, 2013 10:59 am

Prototype pattern
Intent. Specify the kinds of objects to create using a prototypical instance, and create new objects by
copying this prototype

http://code.google.com/p/santysoft/down ... r&can=2&q=

to be continued :)
Best regards,
Oleksandr Antypenko
xHarbour 1.2.3 , Harbour 3.x + Mingw 4.x (HMG, minigui)
https://bitbucket.org/aantypenko
https://github.com/aantypenko

User avatar
esgici
Posts: 4519
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 391 times
Been thanked: 112 times
Contact:

Post by esgici » Tue Mar 05, 2013 11:04 am

Thanks Alex

Regards
Viva INTERNATIONAL HMG :D

Post Reply