Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Larman's System Operation Contracts - confusion with postcondition part

 
Michael Peters
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have some confusion about postcondition part in Larman's design-by-contract approach in his famous book...

Larman creates contracts for system operations. If i have (in technical way) standard system with database, and i have system operation saveEmployee(emp:Employee), what will be postcondition(s) for that system operation? Do i need to mention some postconditions related to database state, for example. "Employee was saved in database" or something like that. My confusion is even bigger with operations like readEmployee or searchEmployees...

What are the implications of these "CRUD like" system operations on domain model state in context of Larman's approach? Do i need to forget about database state in OOA process...?

I would be grateful if someone helped me. I am quite confused.

Please, excuse me for my bad English.
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Michael!
 
naqi saba
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Micheal,

I am interested in undertanding the System Operation Contracts, am reading through the Larman's book as well.
Like you, i'm confused with the post-condition explaination. When reading through the Design By Contract by Bertrand Mayer, even confuse..
not sure how it relates..

If you finally got the answer hope you kind to share.

Naq
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Naqi!
 
Anonymous CowardToo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. First, those Operation Contracts are optional. It might be better for you to create test cases instead.

But to answer your question, the contracts should state the post-conditions, the things that are different after the operation, in terms of the conceptual model.

You can create or destroy instances of concepts. You can form or break relationships. You can modify attributes.

Since the operation contract is an analysis artifact, it does not consider technology at all, and that includes database systems.

Hope this helps!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic