Hello,

I'm trying to implement some functionality that might benefit from the 
strategy pattern.

I found a nice page in the cookbook: 
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/strategy-cookbook-introduction.html

I'm lost when I try to implement my own strategy. I expect to program 
something like

class MyBlockStrategy implements BlockStrategyInterface
{
  function renderFrondend()
  {
    // Code to render frontend
  }

  // Implementation of other methods
}

I now can call the setStrategy method, but on whick object?
AbstractBlock is abstract, so I cannot instanciate it. I could subclass it, 
but what is the use of that, and more: The page starts with:
This recipe will give you a short introduction on how to design similar 
entities WITHOUT using expensive (i.e. slow) inheritance.

So why an abstract Block class.

I'm probably missing something, so please enlighten me.

Toni 


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to