Giter Site home page Giter Site logo

Comments (2)

pauldendulk avatar pauldendulk commented on June 3, 2024

I looked into this. I think we need to implement IDisposable for the samples. I think Thomas mentioned this somewhere before and then the argument came up that the samples are there to show the users how things work and should not be cluttered too much with this kind of thing. In this case it will affect performance noticeably so I think we now have too.

How to keep the samples readable:

  • Perhaps only Dispose the fields if really needed, and ignore it in other situations.
  • Reorganize Mapsui so that the layers and providers are not disposable. The data fetcher should be a central component (most of the time it is the http request or db requests that needs to be disposed) and let the layer be simple data definitions.

from mapsui.

pauldendulk avatar pauldendulk commented on June 3, 2024

Looked a bit more at the code. Disposing samples would need us to store the previous sample, which we don't do at the moment. Perhaps we need to introduce some SampleService for that. A class which could be shared through all our samples. Perhaps some more logic around the samples could be moved in there, for instance access to the list of samples returned by the AllSamples.GetSamples() method, selecting the sample corresponding to the name.

I suggest that the first version of the disposable samples would not add IDisposable to the sample interface, but just for specific ones we decide to dispose, and check for each sample if they implement the interface.

from mapsui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.