declarative

Best way to access table instances when using SQLAlchemy's declarative syntax.

all the docs for sql alchemy give INSERT and UPDATE examples using the local table instance (i.e. tablename.update()... ) doing this seems difficult with the declarative syntax, I need to reference Base.metadata.tables["tablename"] for get the table reference. Am I sposed to do this another way? Is there a different syntax for INSERT...

What is declarative programming?

I keep hearing this term tossed around in several different contexts. What is it? ...

How do I declaratively insert a property value of a page into it's rendering?

I would like to have an aspx page that contains something like.... <form id="form1" runas=server > Hello <%= Me.UserName() %> </form> and a code-behind something like... Public Class Somepage inherits SomeOtherPage Private Readonly Property UserName() as String Get return "Rory" End Get End Property E...

XSL(like) declarative language as MVC view over strongtyped model?

As a huge XSL fan, I am very happy to use xsl as the view in our proprietary MVC framework on ASP.NET. Objects in the model are serialized under the hood using .NET's xml serializer, and we use quite atomic xsl templates to declare how each object or property should transform. For example: <xsl:template match="/Article"> <html> ...

Is a process design really declarative programming?

I've heard from someone that they´re using a business process automation tool (like Weblogic Integration) as a programming language (what sounds like something kind of stupid) to make things declarative. Then they put all the logic inside a process, every single if and while. But, isn´t a process a how to step-by-step entity to reach a ...

Declarative ruby programming replacement for if/then/else/RETURN/end?

I have this showing up all over in my controllers: if not session[:admin] flash[:notice] = "You don't have the rights to do #{:action}." redirect_to :action=>:index return end And its sibling: if not session[:user] and not session[:admin] flash[:notice] = "You don't have the rights to do #{:action}." redirect_to :action=>:i...

Very simple, terse and easy GUI programming “frameworks”

Please list GUI programming libraries, toolkits, frameworks which allow to write GUI apps quickly. I mean in such a way, that GUI is described entirely in a human-readable (and human-writable) plain text file (code) code is terse (1 or 2 lines of code per widget/event pair), suitable for scripting structure and operation of the GUI is ...

Declarative thread safety in .NET

Hi, I need to make an existing app thread safe. Due circumstances (see below), I decided to use one single ReaderWriterLock for the entire graph of business objects. All methods/properties must look like these: public int MyReadOperation(string inputParam) { rwLock.AcquireReaderLock(10000); try { // do all read operation...

ASP.NET masterpages: how to insert markup in the head section inside the aspx?

I know I can access the head section of a page which uses a masterpage programmatically this way (in code behind): This is only an example (I'd like to insert scripts and styles etc.): this.Header.Title = "I just set the page's title"; Is there a simple way to do this in a declarative way on in the aspx file itself? Sometimes it wo...

Declarative validation of forms in Java/Swing

I use Java for client-side development with Swing. I love Swing; I believe it is one of the better GUI frameworks there. What I miss, however, is the support for declarative validation. Like this snippet from XForms. Do you know any library which allows validating data entry in forms in a declarative way, not by writing ugly validation ...

Simplest JQuery validation rules example

The following HTML form successfully utilizes jQuery's form validation, displaying "This field is required" to the right of the form field if left blank, and "Please enter at least 2 characters" if fewer than 2 characters were entered. However, instead of the validation metadata being specified using the class and minlength attributes o...

Elegant examples of xslt?

After a long learning loop via XAML, I've returned to HTML and javascript, and realised that the concept of declarative code - in terms of rules for transformation - is an incredibly powerful concept. Despite its surfeit of syntax, XSLT processing of XML is the keystone of declarative transformation programming. I have, however, always ...

suggestions for declarative GUI programming in Java

I wonder if there are any suggestions for declarative GUI programming in Java. (I abhor visual-based GUI creator/editor software, but am getting a little tired of manually instantiating JPanels and Boxes and JLabels and JLists etc.) That's my overall question, but I have two specific questions for approaches I'm thinking of taking: Ja...

Declarative derived properties for mutable models in Java

Is there a framework for synchronizing properties of POJOs? For example, I want to express (in some high-level, declarative form) that foo.text = bar.text + baz.text or foo.y = (max(bars, y)).y without having to register property change, element add and remove listeners on values and (especially) collections, which are repetitive and err...

Tips for grokking declarative programming languages?

Question As stated, have you any tips to help grok / understand / get-your-head-around declarative programming languages? Or is it simply a case that you’ve to immerse yourself in the language and it’s syntax, until it seeps in, until you get that golden moment where you Get It. This isn’t really an option as I can no longer lock mysel...

Generic Declarative Expression Builder in PHP

Folks, I'm looking to build a piece of PHP5 UI that I'm pretty sure is common to a bunch of applications. Basically, it's an expression builder that allows users to specify expressions combined through logical operators (AND/OR), like this: FieldX > 3 AND FieldY = 5 FieldY = "bob" and FieldZ is not null FieldX > '5/23/2007' OR (Field...

Shortcomings with Declarative Programming

Hey all, I've been reading through previous posts on declarative programming and I think I understand the underlying concepts. Could anyone describe some declarative programming paradigms and what they are useful for, as well as what their major shortcomings are? I'm trying to examine a new application development system that is comin...

Raise MouseButton.Middle in "Click" evenf for a button

I have a button, and when I click on it, I need it to peform as if I have just clicked the scroll wheel on my mouse. Is this possible? <Button x:Name="centreButton" Click="performScrollButtonClick"/> ...

OSGI Declarative Services (DS): What is a good way of using service component instances

I am just getting started with OSGI and Declarative Services (DS) using Equinox and Eclipse PDE. I have 2 Bundles, A and B. Bundle A exposes a component which is consumed by Bundle B. Both bundles also expose this service to the OSGI Service registry again. Everything works fine so far and Equinox is wireing the components together, ...

WF, WCF and Declarative Services (or: What does Microsoft mean by "declarative"?)

I've made this Community Wiki because some may think it's open to debate and others might think it's a question of using words to mean what they really mean (in other words, it's a matter of opinion whether it's a matter of opinion). There's a general question on SO about declarative programming, which has some great answers. But I'm a...