Live data from Hacker News

The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

artima.com

11–20 of 25 posts

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#11
post #7
post #5

Earlier quoted context omitted.

I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games. I have found that with my (minuscule) ECS library it greatly alleviates just about all of the issues I was facing with normal OOP. Everything scales extremely well, the code is almost crystal clear, and it makes code structure very simple. I'm not sure how you could effectively apply ECS outside of simulation style a…

Well, of course ECS does that. It's ultimately the same approach to data as a normalized relational schema. It's a bit of upfront work but the flexibility of processing and optimization is awesome. For UI the issue is one of expressing lightweight dependencies, which may be detached and recombined easily. I am currently exploring an approach that combines "imgui" concepts with hierarchical path data, akin to the hard…

The extreme version of an ECS is an EAV: https://en.m.wikipedia.org/wiki/Entity–attribute–value_model

When you further qualify by time/transaction you get EAVT like Datomic and then just do queries (potentially recursive), and can implement semantics like "classes" over it.

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#12
post #6
post #2

The most interesting part is that as good as this sounds I haven't heard of it again since that article first came out.

The problem with DCI is that it didn't have native support in any programming language. Coplien, one of the co-founders of DCI is actually working on a programming language called Trygve which implements these ideas. https://github.com/jcoplien/trygve

I only skimmed the article, but it the description sounds a bit like some of the ideas in ContextL, an extension of CLOS (Common Lisp's Object System):

https://github.com/pcostanza/contextl

http://www.jot.fm/issues/issue_2008_03/article4/

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#13

DCI piqued my interest when I first heard about it. It seemed to solve some problems I was seeing in the typical model structure of MVC apps. In the end while I still agree with the principles behind context (keeping the primary workflow of a code module linear and organized in one place) I found interactions (mixing in behaviour with data) to be largely unnecessary in actual practice. The problem DCI purports to sol…

As I understand it, DCI slims down classes by moving contextual responsibilities in a contextual helper class. DDD shifts this problem by introducing the Bounded Context concept, where you are encouraged to have, for example, a dedicated, specialized "User" class in the "Billing" context and another specialized "User" class in the "Content" context (and having mappers/adapters between these two classes).

Does this align with what you are saying?

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#14

Another vision of Object-Oriented Programming that has gotten quite a bit of traction. (Especially in the game development community.) Is the Entity-Component-System model: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80... If you want to play Entity-Component-System. I'd suggest you check out A-Frame, a WebVR framework that uses and promotes Entity-Component-System: https://aframe.io/

[deleted]

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#15
post #5

Another vision of Object-Oriented Programming that has gotten quite a bit of traction. (Especially in the game development community.) Is the Entity-Component-System model: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80... If you want to play Entity-Component-System. I'd suggest you check out A-Frame, a WebVR framework that uses and promotes Entity-Component-System: https://aframe.io/

I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games. I have found that with my (minuscule) ECS library it greatly alleviates just about all of the issues I was facing with normal OOP. Everything scales extremely well, the code is almost crystal clear, and it makes code structure very simple. I'm not sure how you could effectively apply ECS outside of simulation style a…

It's strange that ECSs only have traction in game development. I agree with all the advantages you mentioned, but additionally, they solve the structure-of-arrays/array-of-structures performance discrepancy; this is something Jon Blow is working on with his Jai language.

> I spent quite a lot of time exploring ECS before building my own ECS library for developing 2D games.

Is it publicly available?

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#16

DCI piqued my interest when I first heard about it. It seemed to solve some problems I was seeing in the typical model structure of MVC apps. In the end while I still agree with the principles behind context (keeping the primary workflow of a code module linear and organized in one place) I found interactions (mixing in behaviour with data) to be largely unnecessary in actual practice. The problem DCI purports to sol…

It seems that they are trying to develop a model where object behavior can be restricted or modified depending on its uses. In fact, it is a quite important problem and there exist many general models and specific techniques which tackle different aspects of this problem, for example:

o Aspect-oriented: Additional behavior can be injected into classes https://en.wikipedia.org/wiki/Aspect-oriented_programming

o Context-oriented: Behavior depends on the context http://www.jot.fm/issues/issue_2008_03/article4/

o Concept-oriented: Behavior is split between references and objects http://conceptoriented.org/

o Subject-oriented: Behavior is split between objects and subjective perceptions (subjects) https://en.wikipedia.org/wiki/Subject-oriented_programming

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#17

Another vision of Object-Oriented Programming that has gotten quite a bit of traction. (Especially in the game development community.) Is the Entity-Component-System model: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80... If you want to play Entity-Component-System. I'd suggest you check out A-Frame, a WebVR framework that uses and promotes Entity-Component-System: https://aframe.io/

This looks a lot like typeclasses to me.

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#18
post #6
post #2

The most interesting part is that as good as this sounds I haven't heard of it again since that article first came out.

The problem with DCI is that it didn't have native support in any programming language. Coplien, one of the co-founders of DCI is actually working on a programming language called Trygve which implements these ideas. https://github.com/jcoplien/trygve

Is that still being developed? Has some recent commits, but parts of the manual are clearly somewhat out-of-date; for instance, in 5.3.1 (Defining Generics) there's a "try doing that in Java!" that's trivially accomplishable with Java generics.

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#19

DCI piqued my interest when I first heard about it. It seemed to solve some problems I was seeing in the typical model structure of MVC apps. In the end while I still agree with the principles behind context (keeping the primary workflow of a code module linear and organized in one place) I found interactions (mixing in behaviour with data) to be largely unnecessary in actual practice. The problem DCI purports to sol…

Do you think most devs spend enough time thinking through a good way to model what they're building?

Re: The DCI Architecture: A New Vision of Object-Oriented Programming (2009)

#20
post #6

Earlier quoted context omitted.

The problem with DCI is that it didn't have native support in any programming language. Coplien, one of the co-founders of DCI is actually working on a programming language called Trygve which implements these ideas. https://github.com/jcoplien/trygve

There are a few language-specific libraries, including, for Python: https://github.com/amolenaar/roles

I'm not sure I understand the example in https://github.com/amolenaar/roles/blob/master/example.py. Maybe it's just too simple to demonstrate the benefits and so the code seems a little contrived. But why have the `context` thing at all? Why can't TransferMoney just handle the money transfer logic itself, without adding a whole extra layer of indirection with the `context` and then the MoneySource and MoneySink?
Post reply on HN