# New to OOP and Abstract Session Pattern

**URL:** <https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808>\
**Category:** Ruby\
**Created:** [February 22, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808 "2006-02-22T14:39:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [February 22, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808/1 "2006-02-22T14:39:38Z")

</div>

Hello people,

As some of you know, I would like to start “thinking” in objects. So,  
I am trying to study some patterns.  
I’ve actually ordered a book (suggested in this list!). However…  
well, you know 🙂

I am having a bit of a problem understanding the Abstract Session  
Pattern.

> **[WebMD - Better information. Better health.](https://www.webmd.com/?AbstractSessionPattern)**
>
> The leading source for trustworthy and timely health and medical news and information. Providing credible health information, supportive community, and educational services by blending award-winning expertise in content, community services, expert...

Does anybody here know WHY and HOW you’d use it?

Here is the email I sent to the author of the document above -  
unfortunately, I never got an answer. I assume he must get a lot of  
emails like this 😑

Any ideas?

Merc.

Begin forwarded message:

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [February 22, 2006, 5:54pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808/2 "2006-02-22T17:54:59Z")

</div>

Hi,

OK thanks James!

(The list of book I have to read is getting dangerously long…!)

Merc.

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [February 22, 2006, 3:51pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808/3 "2006-02-22T15:51:53Z")

</div>

Tony M. wrote:

> Hello people,
> 
> As some of you know, I would like to start “thinking” in objects. So, I  
> am trying to study some patterns.

Patterns may make little sense if you’ve no experience with OO. Simply  
knowing a pattern isn’t enough to help you determine appropriate use.

Consider looking at

Designing Object-Oriented Software, by Rebecca Wirfs-Brock

Agile Software Development, by Robert C. Martin

–  
James B.

“A principle or axiom is of no value without the rules for applying it.”

- Len Bullard

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [February 22, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808/4 "2006-02-22T21:37:55Z")

</div>

Yeah, I didn’t finish my sentence there, d’oh (need a way to edit  
mailing list messages).

I personally think that by focusing on what an Object can do and how  
it behaves in a system and sort of putting what it stores on the  
backburner (until you need to think about it) can help make it easier  
to think about programming in an Object Oriented style.

---

<div class="post-metadata">

**Author:** ![merc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@merc](https://www.ruby-forum.com/u/merc)\
**Post date:** [February 22, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/new-to-oop-and-abstract-session-pattern/71808/5 "2006-02-22T21:34:53Z")

</div>

Well, the thing is that the AbstractSessionPattern in Ruby looks  
suspiciously like a Factory pattern. The Server is customizing  
instances of Session objects which it is returning.

It’s probablly a fair bit different looking for statically typed  
languages.

OO thinking isn’t going to come through reading patterns. Patterns  
help you recognize how and where you can apply a solution that’s  
already been vetted when you’re designing/coding.

Thinking in terms of Objects will come very naturally as you gain more  
experience.

On the other hand, you might find it a little easier if you thought of  
Objects as Actors instead (that might get confusing though since Actor  
systems are closely related and a little different than Object  
systems). I personally think that by focusing on what an Object can  
do and how it behaves in a system and sort of putting what it stores  
on the backburner (until you need to think about it).
