Tuesday, May 09, 2006

Persistent Domain Objects Pattern.

PDO vs DAO.

I think the DAO method is much more closer to meatspace scenarios. Assuming we have a robot factory.

Pseudo in PDO:

Robot find/get Robot123 and be that robot.

Pseudo in DAO.

RobotManager find/get Robot123 .

I think the machines responsible for finding and extracting Robots from the factory be a different entity. Its more simpler that way.

RobotManager can be an interface and might have varying implementations. This answers the need to decouple the database specific implementation.

No comments: