Skip to content
This repository has been archived by the owner. It is now read-only.

Playing with element polymorphism #9

wants to merge 5 commits into from


Copy link

@tmst tmst commented Jul 31, 2015

I was curious how much of the code could be factored into base classes, and how small the Codelab-specific code could be made. I have tried to do as much as possible while leaving the overall structure of the project intact so as to make before and after comparisons easier.

Composition is now favored over inheritance. In fact, the latest polymer.dart ends support for subclassing custom elements. Indeed, I find the semantics of inheritance in the context of HTML elements very challenging, and was not able to refactor the Codelab classes into an inheritance hierarchy and still have full control over the placement of elements in forms, divs, etc. There appears to be great flexibility in how the inheritance constructs and are included. It is my hope that someone with a greater mastery of these will provide suggestions as to how one should ideally go about it.

tmst added 3 commits Jul 30, 2015
 On branch master
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

	new file:   item.dart
	new file:   item_element.dart
	new file:   item_element.html
	new file:   item_form.dart
	new file:   item_form.html
	new file:   item_list.dart
	new file:   item_list.html

 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   codelab_element.dart
	modified:   codelab_element.html
	modified:   codelab_form.dart
	modified:   codelab_form.html
	modified:   codelab_list.dart
	modified:   codelab_list.html
	modified:   model.dart
Copy link

@googlebot googlebot commented Jul 31, 2015

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.

  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.


Copy link

@googlebot googlebot commented Oct 10, 2015

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.


@tmst tmst closed this Oct 15, 2015
Copy link

@tmst tmst commented Oct 15, 2015

Needs corrections before submitting.


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants