Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add DataTableExtensions.AsDataView #36528

Merged
merged 9 commits into from
Apr 3, 2019
Merged

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Apr 1, 2019

This pushes down the minimal number of types required to implement
DataTableExtensions.AsDataView.

LinqDataView is added in order to implement AsDataView, the following
types need to be pushed down in order to implement this:

  • DataSetUtil
  • DataTableExtensions
  • EnumerableRowCollection
  • SortExpressionBuilder

Moving these down requires that the following also be moved due to needing
internals access to moved types.

  • EnumerableRowCollectionExtensions
  • OrderedEnumerableRowCollection
  • TypedTableBase
  • TypedTableBaseExtensions

This leaves behind only the following types in DataSetExtensions:

  • DataRowComparer
  • DataRowExtensions

I could have moved those as well, but wanted to start from the minimal change and go from there.

@ericstj ericstj requested review from danmoseley and divega April 1, 2019 20:35
@karelz karelz added this to the 3.0 milestone Apr 1, 2019
This pushes down the minimal number of types required to implement
DataTableExtensions.AsDataView.

LinqDataView is added in order to implement AsDataView, the following
types need to be pushed down in order to implement this:
 - DataSetUtil
 - DataTableExtensions
 - EnumerableRowCollection
 - SortExpressionBuilder

Moving thse down requires that the following also be moved due to needing
internals access to moved types.
 - EnumerableRowCollectionExtensions
 - OrderedEnumerableRowCollection
 - TypedTableBase
 - TypedTableBaseExtensions
@ericstj
Copy link
Member Author

ericstj commented Apr 2, 2019

I'll add a couple tests to this, just wanted to share the factoring to get feedback in case folks suggest we do more.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize all of this is copy/paste so I just skimmed it and left a few random comments.

@ericstj
Copy link
Member Author

ericstj commented Apr 2, 2019

@danmosemsft @divega what do you think about most of the DataSetExtensions types being available by default but having to add a package reference for DataRowComparer and DataRowExtensions? Does that seem unusual?

@ericstj
Copy link
Member Author

ericstj commented Apr 2, 2019

I realize all of this is copy/paste so I just skimmed it and left a few random comments.

Thank you @stephentoub. I'll try to apply some generalized cleanup.

@divega
Copy link

divega commented Apr 2, 2019

@danmosemsft @divega what do you think about most of the DataSetExtensions types being available by default but having to add a package reference for DataRowComparer and DataRowExtensions? Does that seem unusual?

I would say push those two also down to System.Data.Common. System.Data.DataSetExtensions can be just about compatibility with desktop.

@divega
Copy link

divega commented Apr 2, 2019

cc @ajcvickers

@danmoseley
Copy link
Member

@danmosemsft @divega what do you think about most of the DataSetExtensions types being available by default but having to add a package reference for DataRowComparer and DataRowExtensions? Does that seem unusual?

I defer to @divega on this one, we also have usage data of course if that's helpful

@@ -12,7 +12,7 @@ namespace System.Data
/// <summary>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume if we push all the implementation to System.Data.Common, we will move these files there and not src/Common/src/System/Data/. I see that as an added benefit. Putting stuff in here has led to code duplication. See #32857.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still build a netstandard implementation here https://github.com/dotnet/corefx/blob/master/src/System.Data.DataSetExtensions/src/System.Data.DataSetExtensions.csproj.

This implementation is used when the package is installed on netstandard2.0 frameworks that aren't netcoreapp3.0 or higher (eg: netcoreapp2.x, uap10.0.16299, xamarin frameworks). We could decide to stop building that in master and just copy it from servicing but it'd mean that you need to make changes in servicing branches rather than master if you wanted to change that implementation.

Note that either way I will ensure that the change does not leave behind duplicate files.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I didn't know that. But I believe we don't build System.Data.Common as a package from master anymore. Does that make stopping building System.Data.DataSetExtensions from master make more sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The System.Data.Common package was eliminated for an different reason, the surface area was absorbed into netstandard2.0, as well as the facade. Because of this netstandard2.0 supporting frameworks must have the dll inbox, and the netstandard targeting pack included a facade to unify the dll to types in netstandard.dll. As such, shipping a package would be pretty pointless since all recent frameworks had to have the DLL inbox.

Contrast that to DataSetExtensions: we aren't getting rid of this DLL. We still need reference assembly for netstandard, we need facade for netcoreapp3.0, and implementations for other frameworks.

If you eliminated the package you'd still need to determine how to deliver the DataSetExtensions facade: put it inbox in .NETCore 3.0? If you're willing to do this, that'd work.

If not, then wait for next release to eliminate the package in master. That way you can use the 3.0 servicing branch to service the downlevel implementations while still producing the facade needed for 3.0.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks for the detailed explanation.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put it inbox in .NETCore 3.0? If you're willing to do this, that'd work.

Would there be any downside to this? It would mean you get compatibility with libraries built against desktop without any additional package, right?

Copy link
Member Author

@ericstj ericstj Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I was not thrilled about adding another DLL inbox, but given that it doesn't add any dependencies and we could think of it like the desktop compat shims (mscorlib, system, system.core, etc) I feel less strongly. It also has the benefit of avoiding a compiler error when folks reference the old package and target netcoreapp3.0.
@danmosemsft @stephentoub any objections?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Size is not an issue here right?

Copy link
Member Author

@ericstj ericstj Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed crossgen'ed facades with a similar number of type forwards are 14KB so that's our upper bound. Lower on linux due to signing differences.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objection.

@danmoseley
Copy link
Member

Likewise, just added comments on trivia.

@ericstj
Copy link
Member Author

ericstj commented Apr 2, 2019

Pushed changes that add tests and address feedback. Waiting for folks to ack #36528 (comment) before I remove the package and reorganize the sources.

ericstj added 2 commits April 2, 2019 14:48
We pushed all the types down into System.Data.Common, and the facade is
now inbox, so the package only remains meaningful to carry a netstandard2.0
implementation assembly.  This assembly is only applicable on older
netcoreapp versions, so rather than ship it from master we'll  service
it from the release/2.1 branch.
Copy link

@divega divega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericstj
Copy link
Member Author

ericstj commented Apr 3, 2019

Fixes #27610 #19771

@ericstj ericstj merged commit 770c50d into dotnet:master Apr 3, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Move most DataSetExtensions code to common

* Add DataTableExtensions.AsDataView

This pushes down the minimal number of types required to implement
DataTableExtensions.AsDataView.

LinqDataView is added in order to implement AsDataView, the following
types need to be pushed down in order to implement this:
 - DataSetUtil
 - DataTableExtensions
 - EnumerableRowCollection
 - SortExpressionBuilder

Moving thse down requires that the following also be moved due to needing
internals access to moved types.
 - EnumerableRowCollectionExtensions
 - OrderedEnumerableRowCollection
 - TypedTableBase
 - TypedTableBaseExtensions

* Add license to LinqDataView.cs

* Add a couple simple AsDataView tests

* Move remaining types from DataSetExtensions to Common

* Clean up source. CR feedback.

* AsDataView test only NetCoreApp

* Make System.Data.DataSetExtensions inbox, remove package

We pushed all the types down into System.Data.Common, and the facade is
now inbox, so the package only remains meaningful to carry a netstandard2.0
implementation assembly.  This assembly is only applicable on older
netcoreapp versions, so rather than ship it from master we'll  service
it from the release/2.1 branch.



Commit migrated from dotnet/corefx@770c50d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants