Would mixins solve this nicely? Split the class in a mixin with the generated contents and a use of the mixin that adds the actual contents?
Cheers,
Kasper
--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
--
You received this message because you are subscribed to the Google Groups "Dart-Web-UI" group.
To post to this group, send email to web...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web-ui/?hl=en-US.
I honestly haven't tried any of the mixin support within Dart so I don't know if there are some limitations within the current implementation that would affect this.
Is there something within the VM that would cause partial classes to be problematic? AKA couldn't Dart have support for both?
Just in my development I've had some pretty monster files that would benefit from partial classes in terms of organization.
Does a mixin have a way to access to the members of the class its being integrated with?
Does a mixin have a way to access to the members of the class its being integrated with?
On Mon, Jan 28, 2013 at 1:13 PM, Gilad Bracha <gbr...@google.com> wrote:
I don't see a need for partial classes, given that we will have mixin support quite soon.
Then when you debug you have to use the copy in the out directory. This sucks workflow wise. I don't know how many times during the course of development I accidentaly modified the output file.
On Mon, Jan 28, 2013 at 2:11 PM, Don Olmstead <don.j.o...@gmail.com> wrote:Does a mixin have a way to access to the members of the class its being integrated with?I think so. If you declare something as abstract* on your mixin, it will be able to access the members of the class it is being mixed in to. It sounds a lot like the collections use cases.(* you probably don't even need to declare it abstract, except to make static analysis happy. You should be able to call anything public on the class you were mixed in to.)
On Mon, Jan 28, 2013 at 1:13 PM, Gilad Bracha <gbr...@google.com> wrote:
I don't see a need for partial classes, given that we will have mixin support quite soon.Agreed. I think we can generate something much nicer once we have mixins. At least--I'd like to try it and see how it works out before asking for other features :)On Mon, Jan 28, 2013 at 11:59 AM, Don Olmstead <don.j.o...@gmail.com> wrote:Then when you debug you have to use the copy in the out directory. This sucks workflow wise. I don't know how many times during the course of development I accidentaly modified the output file.We have a bug on web-ui/buildtool to make output files readonly. So accidental edits will be less of a problem.Also, Siggi is working on source maps, so the debugger will be debugging the original source, not the generated source.Cheers,- John
Okay in that case it sounds like mixins could be used to emulate partial classes. I was under the assumption that a class being mixed in had no knowledge of what it was being combined with in. If that were the case then it couldn't be used. Is this functionality a day 1 thing with the mixin implementation or something further down the line Gilad? I vaguely recall the mixin implementation coming in phases from that proposal you did.
From looking at the generated code from web-ui in my cases it doesn't look like those will be a problem, but John could probably give a better analysis there.
Mixins aren't the same as C# partial classes since each class/file doesn't have to be coupled together, e.g://File1.cspublic partial class A { }//File2.cspublic partial class A { }They also have no restrictions, it's effectively a copy + paste of multiple file fragments together into 1 class definition then compiled as one.It's very little added complexity other than knowing what it does, i.e. copying + pasting is easy to explain :)
--
John if you have a Windows box lying around I'd take a look at how Visual Studio does WPF projects. Its integrated really nicely into everything despite having generated code going on under the hood. Might give some insight on how Dart Editor can present the whole Web Components thing. Overall I've been really happy with Web Components minus modifying the output one too many times ;)