which pattern to use?

I have an interface 'Rule' which defines 5 methods. I have 2 classes 'ShiftRule' and 'GroupRule' which implements the 'Rule' interface. At run-time i will be using either 'ShiftRule' or 'GroupRule'.

What pattern I should use for the above case? Please provide a link.

Thank you

[310 byte] By [uryl99a] at [2007-10-2 0:53:35]
# 1
The Factory pattern. Do a Google search.- Saish
Saisha at 2007-7-15 18:13:18 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
I think the best fit paatern over this scenario is Abstract Factory.
khindria at 2007-7-15 18:13:18 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
FactoryMethod works as well and is simpler to implement. I occassionally do use AbstractFactory, but rarely is that kind of pluggability needed for implementors of a single interface, IMO.- Saish
Saisha at 2007-7-15 18:13:18 > top of Java-index,Other Topics,Patterns & OO Design...
# 4
u can use IOC but it would be costlier.its better to go for Abstract Factory Design Pattern
phanidharkumara at 2007-7-15 18:13:18 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
http://www.dofactory.com/Patterns/PatternStrategy.aspx
mchan0a at 2007-7-15 18:13:18 > top of Java-index,Other Topics,Patterns & OO Design...