Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Broadcast / Observer Pattern (active objects)

55 views
Skip to first unread message

pandelis

unread,
Jun 3, 2010, 4:36:34 AM6/3/10
to CslaGenerator
Active objects are down.It seems that there is still some support in
cslagenerator. I am interested in experimenting in that direction and
it would be nice to know if i can use active objects with the latest
versions of csla.

Does anyone have active objects and thinks he can share?
Do you know of another project, like active objects, that would work
with csla?

Andrés Villanueva

unread,
Jun 3, 2010, 8:01:03 AM6/3/10
to cslage...@googlegroups.com
I use active objects. If you're looking for a 2.x version, it's there in the files section of cslagen forum.
If you need a modified version that will work with csla 3.x. let me know and I can upload that too.




--
Andrés

pandelis

unread,
Jun 4, 2010, 1:39:38 AM6/4/10
to CslaGenerator
If you could share Andres i would be in your debt. Thank you.

Andrés Villanueva

unread,
Jun 4, 2010, 10:39:54 AM6/4/10
to cslage...@googlegroups.com
I uploaded it to the group:
http://groups.google.com/group/cslagenerator/web/AO_Observer-35.rar

This version works with csla 3.x.

On Fri, Jun 4, 2010 at 2:39 AM, pandelis <pande...@yahoo.com> wrote:
If you could share Andres i would be in your debt. Thank you.

--



--
Andrés

pandelis

unread,
Jun 7, 2010, 1:30:22 AM6/7/10
to CslaGenerator
Thank you Andres!

tarekahf

unread,
Jun 8, 2010, 4:51:07 AM6/8/10
to CslaGenerator
I hope some one could tell me what is Actove Objects, and what is the
relation to CSLA Generator and/or CSLA .NET Framework.

Tarek.

pandelis

unread,
Jun 9, 2010, 1:58:06 AM6/9/10
to CslaGenerator
this is some context taken from codeproject as i can't have said it
better

""The Observer Pattern is a mechanism for drastically reducing
coupling between interacting classes. The observer pattern should be
used whenever one or more objects (observers) must track changes in
the subject. The subject maintains a list of its observers. Each
observer must register as an observer of the subject. When the subject
changes, it notifies all its observers that it has changed. The
observers are then responsible for querying the subject for any
additional information they need about the changes to the subject.""

http://www.codeproject.com/KB/architecture/ObserverBySunilKumarKS.aspx?display=Print

Active objects was created to apply this behaviour to CSLA! the
project was abandoned years ago, or so i thought! Luckily Andres is
still using it, and generous enough to share!

tarekahf

unread,
Jun 9, 2010, 3:21:40 AM6/9/10
to CslaGenerator
Ok, now I am in a better position.

Please allow me to ask a couple of more question to clarify more
items.

- How do you rate the benefit of Observer Pattern/Active Object from
your prespective ?

- Since this is under CSLAGen, then I suppose it will help you
generate the code using Observer Pattern based on CSLA, is my
understanding correct ?

- What is the popularity of this approach ?

- Also, I posted a question some time in the past about CSLAGen, but I
did not get reply. I want to know about your experience using CSLAGen
in general and what is your feedback ?

Tarek.

pandelis

unread,
Jun 9, 2010, 5:12:56 AM6/9/10
to CslaGenerator
1) i was thinking of using active objects to keep some csla objects
synchronised throughout the network. For example i want to create a
simple network messaging service. Of course i can create a message
object and relate it to the user delivered and the user sent. I was
thinkingof creating notifications for my users based on whether the
message arrived or not, or creating other real time notification that
derive from other users on the netowork. Which is cool btw. Hopefully
i am on the right track here.

2) When using cslagenerator and create your first class, you will see
in the csla object window a 11. Active object related Group, where one
can subsribe the class to listening events.

3) Popularity? Windows Azure has a similar messaging service (and a
better one for that matter) that CHARGES its use per message. Please
correct me if i am mistaken

4) Sorry for not replying but to be honest, each persons experience on
generators differs. The purpose of course is to increase productivity.
But what is your background, what is your purpose and daily workload?
I can tell you why i prefer cslagenerator in comparison to other
solutions.

I tried CslaGenerator and i didnt like the approach it took on
creating windows forms ( i use devexpress)
I tried codesmith and on first sight seemed it needed more effort on
my side, especially on training. Although one can say if properly used
it can be more productive especially since you can create UI as well
( i believe)
I tried sculpure. I like that tool, but again it requires lots of
effort on my side and i dont have the time.

Why use clsagenerator? First of all it does all the work for creating
csla objects and stored procedures in many languages. It takes care
for much of the complexity involved including network issues. Ongoing
project and above all FREE. It saves me a lot of time, it does all the
things i need and i only need to do the interface which i like to do
myself anyway. I dont like the automated default UI output of other
generators (so far). I can also make changes to the way my code is
generators by changing the templates myself. Or i can create add-ins
that do things i want.

In few words, you download it, connect too a database, and then its
pretty straightforward even without training.

Also Andres is a great guy, who really wants to help out.

pandelis

unread,
Jun 9, 2010, 10:15:13 AM6/9/10
to CslaGenerator
Correction !

> I tried CslaGenerator and i didnt like the approach it took on
> creating windows forms ( i use devexpress)

At that part i meant CodeComplete

tarekahf

unread,
Jun 10, 2010, 10:40:58 AM6/10/10
to CslaGenerator
Pandelis,

What I can say? you are wonderful!

I feel very happy with your reply.

I downloaded CSLAGen some time ago, and I liked it, but when I posted
here, and no one replied, I was thinking its dead.

As you know, one of the factors that pushes me to use CSLAGen or other
Code Generators, is you find poeple around you who are using the same
tool, so that just in case you get stuck, there is a chance you will
get help.

I like CSLA.NET 2.0 (under VS2005) very much, and I am using about 70%
of its feature set for the past 2 years. I have recently pruchased
Expert VB 2008 Business Objects Book and planning a major jump to
CSLA.NET 3.x + .NET 3.x + VS2008. I never used Code Generators, cause
I thought they are going to be burden on me. I decided to use one now,
and I am consedring CSLAGen. For more info anout my background, you
can follow me on http://twitter.com/tarekahf , and I will follow you
too!

Taking into consideration my current situation, and where I am going,
how do you rate the suitability of CSLAGen for my work ?

And, sorry for asking toooo many questions.

Thank you in all cases.

Tarek.

Nisad

unread,
Jun 11, 2010, 12:33:30 PM6/11/10
to CslaGenerator
Hi,

Is there any example how to use it, or if you have some, can you share
it? What actually "Subscribe To Chanel" means?
Most of the sites referenced on start page of CSLAGen are down so
there is no place to go. Sorry to bother you.
Thank you,
Nisad.

On Jun 3, 7:01 am, Andrés Villanueva <xal1...@gmail.com> wrote:
> I use active objects. If you're looking for a 2.x version, it's there in the
> files section of cslagen forum.
> If you need a modified version that will work with csla 3.x. let me know and
> I can upload that too.
>

pandelis

unread,
Jun 11, 2010, 1:29:11 PM6/11/10
to CslaGenerator
By the way if you decide to use this generator and you are upgrading
to csla 3.x while using VB .net, you can chech this discussion topic
http://groups.google.com/group/cslagenerator/browse_thread/thread/c079b18be66fd155,
where we discussed some issues that i had while upgrading.

pandelis

unread,
Jun 11, 2010, 1:37:03 PM6/11/10
to CslaGenerator
We were lucky that Andres, had the files to begin with! I haven't
delved into the code yet, but hopefully i will succeed in making an
example and sharing. The first part being the most important.

Nisad

unread,
Jun 12, 2010, 11:31:33 AM6/12/10
to CslaGenerator
Actually I was asking Andres.

Tiago Freitas Leal

unread,
Jun 12, 2010, 12:04:03 PM6/12/10
to CslaGenerator
Hi Pandelis

On 9 Jun, 10:12, pandelis <pandela...@yahoo.com> wrote:

> 1) i was thinking of using active objects to keep some csla objects
> synchronised throughout the network.

ActiveObjects or any other standard implementation of Observer pattern
won't do it. I know a single attempt to solve this problem and the
author is... Rocky Lhotka on an article "Broadcasting Messages to
Multiple Clients" publish by MSDN back in June 2, 2004
I'm afraid this is no longer online. There was a problem concerning
lock timeout inherited from the Framework Lock implementation, I
solved it using on open source alternate implementation and all my
tests showed it was working. This is not a straightforward solution
though.
Rocky's solution was just a messaging system with publisher and
subscribers with the former notifying the later when there were
changes to objects.

I can send you by email the original article and code, along with my
own developments on that code.

Regards

pandelis

unread,
Jun 12, 2010, 12:52:28 PM6/12/10
to CslaGenerator
Yes that would be most helpful Tiago. Thank you. I haven't had the
chance to test active objects either. Thank you for mentioning this,
it saved me lots of time trying to get it to work.

Andrés Villanueva

unread,
Jun 14, 2010, 9:16:25 PM6/14/10
to cslage...@googlegroups.com
Active objects has been undocumented and unmaintained for quite a while. It's an extension to csla created by Petar Kozul that had many many features of which I only used 2: Observer pattern and Channel Events.
The former was a great way back in the day to get notifications of child changes, but in the latest versions of csla, there's a new event that notifies child changes, so that has become less useful.
The latter is still rather useful and is the thing I use the most. Channel events let you trigger a global event that is listened by any subscribed objects. That piece sounds like what any good old event would do, but the good part about Petar's implementation was that if you triggered one of those remotely (think remoting, wcf, or any remote dataportal), they would be preserved with the object that fired them before serialization and refired at the client after deserialization (don't mistake this part: only the client that originated the call gets the event, not every client of the app). Plus, it used weak references to hold any listeners, so that if those listeners ceased to be used, they could be garbage collected instead of remaining in memory just because there's a reference to them from the channel.
This wouldn't be too hard to achieve in a personal implementation, or even by reusing some of Petar's old code. In fact the observer library is the one that holds the bulk of that code.

The point I'm trying to make is that while it has value to me to keep compatibility because of all the applications I have built with using that technology, I belive it's not worth it if you're just getting acquainted with it. More over, back when I was just starting to learn about csla, I was learning both csla and active objects at the same time, which made it much more complicated to digest. I don't know if that's your case, but it was worth mentioning.


Anyway, sorry for the delays in responding, I've been plenty busy!

Cheers!


--
Andrés
Reply all
Reply to author
Forward
0 new messages