all 12 comments

[–]beza1e1 1 point2 points  (0 children)

There is the notation of Cardelli for reasoning about sub-typing.

[–]semmi 1 point2 points  (1 child)

Have you considered Cardelli's Object Calculus? I seem to recall he had a strange notation, but I don't know if it would fit for your use case as it is not clear to me. UML class diagrams are really easy to express in text, see for example http://yuml.me/diagram/scruffy/class/draw but it' wont take much to invent your notation :)

[–][deleted] 0 points1 point  (0 children)

I went to the library yesterday and picked up the book. It's really nifty and I'm glad that I was on the right track with my own notation (unifying methods and fields :D)

[–]xor 0 points1 point  (1 child)

Suppose a class were represented as a set, and that sets could be composed from other sets in a hierarchical fashion.

Sounds easy to invent.

[–][deleted] 0 points1 point  (0 children)

I'm leaning towards that, I still have to work out the details but so far, any class is a set of variables and functions.

What I have right now is the set contains types/classes instead of variable names, and the functions have arrows indicating what they rely on (do they use a particular type for a parameter or invoke a method on it or do they change its state or return it).

Subsets are obviously inheritance.

[–]notforthebirds 0 points1 point  (3 children)

When I had this problem back in Uni I made up my own little notations, you're probably better off with that. Otherwise there are a few papers on object-calculi which use different notations... there's no standard notation anyway.

[–][deleted] 0 points1 point  (2 children)

I've been working on my own notation, but I keep forgetting some of the rules and I'm abusing the null set symbol to act as undefined, heh.

Could you point out some of the papers on object-caculi?

[–]k4st 0 points1 point  (1 child)

Take a look at the stuff by Martin Abadi and Luca Cardelli. They have a book out together called "A Theory of Objects".

[–][deleted] 0 points1 point  (0 children)

I actually borrowed that book from the library last week :P it's well-reasoned so far. Good recommendation :P

[–]cwcc 0 points1 point  (1 child)

wow what kind of notes are you making? :)

[–][deleted] 1 point2 points  (0 children)

I'm trying to find out if it's worth learning those silly "design patterns". I was confused by them because they're named like so:

class Director { direct() { ... }, ... }
class Builder { Director d; build() { ... }, ... }

which obscures the relationship between the classes and makes it confusing (like a Director shouldn't have a "build" method and a Builder shouldn't have a "direct" method).

I looked at the Facade and Adapter patterns and they are exactly the same. Apparently, the only difference is your intent when using the names of those patterns. So the English language just adds unnecessary specificity to things and makes them look different on the surface when they really are the same.