Re: [w3c/webcomponents] Alternative proposal for closed shadow DOM (#499)

@mrmr1993 
you're still dealing what you want, not what is correct approach from OOP point of view. As already mentioned, _closed_ flag does not prevent you to do whatever you want with that component (licence does), you can change it to _open_ in source, you can hijack _attachShadow_. It's not there to prevent you to touch it. It simply say something about the internals. I believe @andyearnshaw explained the difference between flag and licence quite well.

Using internals for plain object and for ShadowDOM is exactly the same. There is no difference, it is private logic, you can expose private property in object as well and face unintentional consequences, because the object never assumed that this particular property can be changed outside of internal logic. The fact that end user does not see object, but sees a control makes no difference.

--------------------------------
Let me give you example of difference between _open_ and _closed_ based on usage, not on what anyone wants.

Let's say I have application with calendar and list of events in selected day.
The calendar is clearly a control (_closed_), you should not be able to touch it, delete a week, move Tuesday after Wednesday... And that is what the _closed_ says. And then there are 2 scenarios. I'm either a poor developer or my intentions are only to use it in this app for Czech users, so I will hard code Czech day names, week starting at Monday etc. Which would make it most likely useless for you. If I were to release it under some OS licence, you can fork it regardless of the flag, If I were to release it under closed licence, you cannot do anything, regardless of the flag. Or I intend it to be full blown reusable control, so I implement internationalization, I implement some sort _cellDisplay_ callback with some object as a parameter that will allow you to control font, borders, background, I can pass DocumentFragment so you can create overlays. This is up to possibility of the control, but the _closed_ flag says, that the internal DOM structure should not be changed, that I ma
 y rely on consistent logic of that structure, the same way as private properties, methods of ES code tell.

The event list, the list, that is displayed when day is selected is different story. It's a box with date/time of the event, name, location, description, maybe with some control buttons... It's something that in desktop programming is called frame (poor name for Web dev. though :(, component module? object view? control box? ). It has some properties of control (object). It  Is instantiated more than once, in all cases it serves the same purpose but with different attributes (display of event, but different events), it has properties of its own (e.g. background) method of its own (displayEvent(Event event)), it has its internal logic (if I click delete button, event gets deleted, no need to code it outside), but there is no need do shield it. There is no need to protect internals, programming that I should not expect the DOM to exist as designed at any time (always test for existence of element, in _closed_, good practice, in _open_ mandate). If "the outside" will want to change inte
 rnal structure, why not...  (in desktop programming the frames' controls are by default public/published). It's just a view.
--------------------------------
I hope you can see the difference based on usage / OOP theory, not whether we like some programming paradigm or not.

And yes, opinion of the autor is more important, that opinion of the developer/user of the component, whether it's expressed by licence (which you cannot touch) or _closed_ flag, which you can touch (based on licence)

@dylanb 
You are confusing openness of the technology, with openness of the licence. You cannot copy some web page without authors' permission regardless of the fact, that it was written in HTML/CSS/JS (open technologies). Your post is more like plea for OS licences than open technologies. As mentioned several time, the difference is about licence, not the flag. The _closed_ flag is not about "you never ever can because I, author, am the smartest one", the same way declaring property as private is not. It simply says "here you have public API, here are my privates" you [should](https://www.ietf.org/rfc/rfc2119.txt) not touch that. But if released as OS, do what ever you want in the end.... 

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/499#issuecomment-219073204

Received on Friday, 13 May 2016 15:16:01 UTC