Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [object-oriented]

Questions related to using or implemented object-oriented design patterns in Mathematica

7
votes
2answers
170 views

Weighted graph with multiple different coloured non-weighted paths - styling

This follows on from my previous question answered here. Ultimately, I now have a graph which I've simplified for posting here: ...
23
votes
2answers
286 views

Implementing a chat system in Mathematica

My friends and I don't want to use Slack or Gitter, but instead a pure-Mathematica chat system. Now that the ChannelFramework exists, how could we do this?
4
votes
0answers
63 views

What can the *MutationHandler* functions do? [duplicate]

So in this answer we see the only use I know of of the function Language`SetMutationHandler. And just to see what it could do I tried it on one version of my OOP ...
7
votes
3answers
175 views

How to disallow the application of functions outside a white list?

In an earlier post I described a special kind of list (actually, a special kind of multiset) that can be represented more efficiently with a structure like this: ...
20
votes
3answers
747 views

How to implement a discrete data representation?

I'm currently working with large datasets of "discrete data". Each of these is a multiset of real numbers of the form $kS + B$, where $k$ is an integer, and $S$ (the "scale") and $B$ (the "bias") are ...
1
vote
0answers
33 views

Is there a Mathematica equivalent of other languages dictionary objects? [duplicate]

What is the propper way to create the equivalent of a dictionary object in Mathematica? For instance, say roughly that the desired dictionary has the form ...
4
votes
2answers
251 views

How to call Picture Bed API

I want to call this Picture bed API to upload my picture and return its link.I have translated the official instructional the page into English.And there is a example succeed to use it with Python. I ...
2
votes
0answers
86 views

Does Mathematica have a method for achieving the same goals that Aspect Oriented Programming does?

I imagine that this question has been asked before, yet I'm not able to find an answer using the form of the question I believe might be asked. Is there a mechanism for duplicating the ...
38
votes
1answer
1k views

Which Object-oriented paradigm approach to use in Mathematica?

Which Object-Oriented Paradigm (OOP) approach to use in Mathematica for: general implementation, or a particular project? There are a lot of related questions and answers in MSE on doing OOP that ...
2
votes
0answers
117 views

A certain kind of Object Oriented functionality in Mathematica?

I'm looking to implement a certain aspect of object oriented programming in Mathematica. I've read a lot of the big threads where people have discussed different approaches to implement OO in ...
2
votes
0answers
71 views

How to implement shared data structures?

If I have a shared data structure like you would find in nested C structs, how would I best implement that in Mathematica? I have some "object-oriented" code I would like to port to Mathematica. It's ...
6
votes
0answers
76 views

How to set a property in an object with association syntax? [duplicate]

I have a simple object orientation example using this solution: ...
7
votes
1answer
226 views

How does thing[“property”] syntax work?

Many builtin "things" support the (usually undocumented) syntax thing["property"], and usually the available properties can be listed using thing["Properties"] (thing["Methods"] might work too). ...
2
votes
0answers
232 views

Custom Head for Encapsulation

Often when I'm writing a project in Mathematica, the number of arguments I must provide to functions spins out of control. I need a sort of object-oriented encapsulation approach. I've already had a ...
7
votes
4answers
726 views

How to combine Date and Time objects into DateTime object?

Considering a DateObject d and TimeObject t: ...
3
votes
0answers
99 views

how implement OOP [duplicate]

I have a task implement OOP in wolfram mathematica. I think write class Point and inherit from it class Rectangle. In C# or C++ it's very easy, but I don't know how do it in wolfram mathematica. All ...
4
votes
1answer
295 views

Inheritance in Mathematica using pattern matching on UpValues

Edit: I think in my original post, I missed emphasizing the main point. This is mainly a pattern matching question. If you're interested in the 'why' of this question, please read the original post ...
3
votes
1answer
140 views

Experiment with TagSetDelayed involving Part

Reading Associating Definitions With Different Symbols, I was intrigued by this: You can think of upvalues as a way to implement certain aspects of object-oriented programming. A symbol like ...
1
vote
0answers
42 views

How to implement a set method? [duplicate]

I'm trying to program using object orientation in Mathematica. For this i need to implement get and set methods. Lets consider that we are working with a person class, that have the fields name and ...
6
votes
0answers
129 views

Modify NDSolve`StateData (if possible)

I am trying to solve a PDE that needs to be scaled constantly (refer to this). @andre suggests I modify NDSolve`StateData. Now, the problem is, I'm not used to ...
71
votes
4answers
5k views

Once more on object orientation in Mathematica: does it have to be so hard?

Recently I came across a set of problems which would be solved most easily within an object-oriented approach. I first attempted to solve them by other means, but found the complexity of the code ...
4
votes
1answer
405 views

Do “objects” in Mathematica have to be declared?

A while ago I learned a trick which allows one to imitate object-oriented programming in MMA using SubValues: ...
22
votes
2answers
2k views

Code Readability and Object-Oriented Code

The basic problem I have been running into is making readable code, where in other languages I am more familiar with I might have been using class or struct like objects. For example, you can imagine ...
18
votes
4answers
6k views

How can I implement object oriented programming in Mathematica?

Roman Maeder's object oriented programming package is nice, but I'm hoping someone can suggest a sleek and novel implementation that is easy to use.