Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Design Pattern and ABAP Objects

Former Member
0 Likes
844

Hello Friends,

I would like to know, if ABAP Objects can be used to do pattern oriented programming ?

For example GANG of four has provided almost more then 30 design pattern ( MVC, singelton, Obserable, FACADE,,,etc) can we implement patterns using ABAP ??

Many thanks

Haider Syed

7 REPLIES 7
Read only

thomasalexander_ritter
Product and Topic Expert
Product and Topic Expert
0 Likes
652

Hi,

of course, you can. This week I implemented the observer pattern in one of my bsp applications and it works great. All the popular patterns like command, singleton, factory, visitor are very easy to implement when using ABAP OO.

regards

Thomas

Read only

0 Likes
652

Hi Thomas

nice to listen that u implemented observer pattern in BSP, is there some kind of utility avaiable like in java we have Observer and obserable ( interface and class) in I think java.util package avaiable, or all logic of observer you have implemented by your own ??

Thanks

Haider Syed

Read only

Former Member
0 Likes
652

Hello Thomas,

It would be great if you could provide a link which introduces the various design patterns.

Regards,

Anand Mandalika.

Read only

christian_wohlfahrt
Active Contributor
0 Likes
652

Hi!

Have a look at topic

So it can be used, but currently there is not much available (interpreting the missing comments after Subramanian V.'s post).

Regards,

Christian

Read only

0 Likes
652

Hi

Thanks to all for their reply

Yes it would be great, if some one point out any useful resourse in this regard,

Many thanks,

Haider Syed

Read only

0 Likes
652

Hi,

Take a look at the following site:

http://patternshare.org/

It has all the basic patterns from the GOF and a lot more. I can recommend the ones from Martin Fowler but be sure you start with the ones from the GOF.

All patterns are described by using UML so it's very easy to translate them into ABAP OO code.

Regarding your other question. For the observer pattern I used an interface which the SAP had already created if_cm_observer and created my own abstract observable class. The observable class is nearly a 100% copy of the java.util. one

regards

Thomas

Read only

0 Likes
652

hi

Thanks for sharing the knowledge, I was in search of if_cm_observer interface

with regards,

Haider Syed.