views:

86

answers:

1

Hi I'm studying "Transaction Script" , "Table Module" and "Domain Model" but it seems somehow complecated to me.

Could you please give me an example which compares these three methods?

Thank you

A: 

I hope you're referring to Fowler's book on the same - http://martinfowler.com/eaaCatalog/

  • Transaction Script is primarily procedural.. So you'd have one function/script that sequentially does steps (each of which effect some change)
  • Domain Model is OO and requires the most work - you need to come up with a shared language and an object model that reflects the objects of interest in the domain.
  • Table Module is new to me. It also looks OO except for the fact that it places more importance on the DB Schema.. The Table-Module-Object looks like a GateKeeper to a particular DB Table. All logic associated and operating primarily on the data in a DB table are housed in the corresponding TableModuleObject. Quoting from the link

The primary distinction with Domain Model (116) is that, if you have many orders, a Domain Model (116) will have one order object per order while a Table Module will have one object to handle all orders.

Gishu