Questions tagged [contract]

424 questions
1
vote
1 answer

Is an exception a valid postcondition?

Consider the following interface: public interface AISPI { public Path getPath(Entity entity, Entity target, World world) throws NoPathException; } Granted that entity, target, and world are all valid input. But the algorithm used to find a…
1
vote
1 answer

XML inside an string element vs independent elements

What are the conceptual and technical disadvantages of this request/response structure: A)
Kevin Macejko
  • 97
  • 2
  • 11
1
vote
1 answer

Elm - open ended types in a contract

Given the pseudo-contract: condy: Int -> Int -> a -> b condy n m a b = if n == m then a else b how can one define the above contract correctly such that the types of a and b are equal but can be any type? Effectively the above removes the need…
category
  • 2,113
  • 2
  • 22
  • 46
1
vote
0 answers

Need an example of using design by contract in Symfony

I am trying to build an API proxy for an external API in my Symfony app. So my Symfony app uses design by contract principle. So a backend service to query the external API. I need to use "coding by contract" principle with an interface so that the…
Fahad
  • 99
  • 7
1
vote
3 answers

Comparator and violating the contract of set

The JavaDoc of Comparator states that It is strongly recommended (though not required) that natural orderings be consistent with equals. They also give an example of a "strange" behaviour when (a.equals(b) && c.compare(a,b) != 0). Now, can…
Ulrich Scholz
  • 2,039
  • 4
  • 30
  • 51
1
vote
1 answer

Should a Foldable always return all its results exactly once?

Here's a type for cyclic, directed graphs with labelled nodes and edges. import qualified Data.Map as M import Data.Foldable import Data.Monoid data Node n e = N n [(e, Node n e)] -- the node's label and its list of neighbors newtype Graph n e = G…
Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157
1
vote
3 answers

What contract am I not specifying?

When I try to run my Windows Store app, it won't, and shows me this: ..."does not support the contract specified"? What contract? I'm not implementing any contract; I assume it means the Settings contract or some such, but I'm not doing any of…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
1
vote
1 answer

Getting the contract

Is there a way to get a contract from a running service programatically? I want to compare the contract of a running service from a referenced contract in the client side. For example I have two instances of Service1 running on different machines…
Lance
  • 2,774
  • 4
  • 37
  • 57
1
vote
1 answer

Open folder based on string?

I'd like to write a bat file that can open a folder based on a string. For instance if the job code is A100 I'd like it to open X:\A Contracts\A100 for B200 X:\B Contracts\B200 etc. i.e. A etc. is the contract and needs to be one string to allow the…
Bennp2000
  • 11
  • 2
1
vote
0 answers

Easy 2d graph animation software

I would like to animate a graph theory algorithm, which contains some edge contractions. It would be nice to animate these contractions, thus the viewer can follow these changes in the topology. Is there any free software for this simple task?…
dlpyth
  • 33
  • 5
1
vote
1 answer

How to define message contract to get this schema?

How can i define the Message contract to get this XML SOAP format? Schema: 123 656 I created the class file as…
user2015534
  • 89
  • 1
  • 1
  • 6
1
vote
1 answer

In-App Purchase returning 0

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { returned a SKProducstResponse with a products array size of 0. Why is this? If it can't find the product it should return a 0 right? I checked…
user3347073
  • 137
  • 1
  • 5
1
vote
1 answer

How to document object's contract

I'm trying to find a good way to document expected "interface" or "contract" of an object in JavaScript, e.g. which methods would be called, which properties are expected to be present and so on. I want it to be as close to code as possible (e.g.…
ovolko
  • 2,777
  • 2
  • 21
  • 26
1
vote
0 answers

Racket Contract Failing Where It Shouldn't

I have a struct that represents a move (struct move (tile x y rotations) #:prefab) Pass is also allowed, so I have a bool that test for an action: (define (action? v) (if (or (pass? v) (move? v)) #t ;; else #f …
gamda
  • 580
  • 6
  • 24
1
vote
1 answer

Best practice using service contracts(one service or multiple) in WCF

Currently i've started developing a wcf service which provides Webshopdata, but something isn't clear enough. In my case i have multiple service contracts like Product, Order, Account and Cart. Each contract has about 10 to 15 methods and they don't…
SAST
  • 11
  • 1