What makes a good spec? [closed]

The best spec is one that: Exists Describes WHAT, not HOW (no solutions) Can be interpreted in as few ways as possible Is widely-distributed Is agreed-upon as being THE spec by all parties involved Is concise Is consistent Is updated regularly as requirements change Describes as much of the problem as is possible and practical … Read more

Specification Pattern in Domain Driven Design

I think Specification pattern is not designed for query criteria. Actually, the whole concept of DDD is not, either. Consider CQRS if there are plethora of query requirements. Specification pattern helps develop ubiquitous language, I think it’s like kind of a DSL. It declares what to do rather than how to do it. For example, … Read more

Nested object initializer syntax

This syntax is called Object Initialization. C# specification clearly gives a lot of examples on this subject: 7.6.10.2 Object initializers An object initializer consists of a sequence of member initializers, enclosed by { and } tokens and separated by commas. Each member initializer must name an accessible field or property of the object being initialized, … Read more

Why don’t the modern browsers support PUT and DELETE form methods?

Some web frameworks (e.g. Ruby on Rails) get around that by including a hidden _method parameter in the form with the value of the “actual” method, e.g.: <form action=”/posts/xxxxx” method=”POST”> <input type=”hidden” name=”_method” value=”DELETE”> <input type=”submit” value=”delete”> </form> The framework then rewrites the request on the server side before processing to use the value of … Read more

Difference between specification and a policy?

The main idea behind SPECIFICATION is that it’s a predicate, which often implies using logical operators with it SPECIFICATION is an adaptation of an established formalism (Eric Evans DDD, p. 274) for example we can say that the box is red, i.e. satisfies some RedSpecification. We can declare some GreenSpecification, and even a composite RedOrGreenSpecification. … Read more

How to create Document objects with JavaScript

There are two methods defined in specifications, createDocument from DOM Core Level 2 and createHTMLDocument from HTML5. The former creates an XML document (including XHTML), the latter creates a HTML document. Both reside, as functions, on the DOMImplementation interface. var impl = document.implementation, xmlDoc = impl.createDocument(namespaceURI, qualifiedNameStr, documentType), htmlDoc = impl.createHTMLDocument(title); In reality, these methods … Read more

Understanding the “additionalProperties” keyword in JSON Schema draft version 4

You have found an error in the spec, so your not actually misinterpreting something. There is an updated version (from two days later) of the internet draft on the IETF website, where this example is different. see: https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00#page-13 As the document is an internet draft, most likely the version on http://datatracker.ietf.org/ is the correct version. … Read more

Default width/height of an IFrame

I found the answer on the dev-tech-layout mailing list — it’s part of the CSS spec. The default ratio is 2:1. The default width of 300px is defined in the last paragraph of the CSS spec, section on the width of inline replaced elements. Otherwise, if ‘width’ has a computed value of ‘auto’, but none … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)