aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Larman's System Operation Contracts - confusion with postcondition part Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Larman Watch "Larman New topic
Author

Larman's System Operation Contracts - confusion with postcondition part

Michael Peters
Greenhorn

Joined: Feb 18, 2011
Posts: 1
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

Joined: Dec 20, 2006
Posts: 2510
    
  10

Welcome to the Ranch, Michael!


OCUP UML fundamental and ITIL foundation
youtube channel
naqi saba
Greenhorn

Joined: Mar 13, 2011
Posts: 1
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

Joined: Dec 20, 2006
Posts: 2510
    
  10

Welcome to the Ranch, Naqi!
Anonymous CowardToo
Greenhorn

Joined: Jun 01, 2013
Posts: 1
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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Larman's System Operation Contracts - confusion with postcondition part