Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to put DisplayI2C class in project #9

Open
erikmf12 opened this issue Jan 14, 2020 · 8 comments
Open

Refactor to put DisplayI2C class in project #9

erikmf12 opened this issue Jan 14, 2020 · 8 comments

Comments

@erikmf12
Copy link

@DzeryCZ Now that I'm sitting down looking at this it's sort of hard to manage this stuff since it's not in a project/solution. It would make it a lot easier if you created a class library project CharacterLcdOverI2C to hold the DisplayI2C class and anything related to that, then a CharacterLcdOverI2C.Examples project in the same solution to house the examples. That way, when someone wants to make a pull request or change an example they can just change one or the other.

Right now it's hard for me to change the DisplayI2C class, switch to an example, copy the class, make changes, switch back, etc...

Thoughts?

@DzeryCZ
Copy link
Owner

DzeryCZ commented Jan 14, 2020

I see, what about a symbolic link? Could we use it in examples?

How is it with a NuGet package, does a person (who wan to use this lib) get only the class or the whole git repo?

@erikmf12
Copy link
Author

In the examples we would just reference the project that the class is in, then use it as if it was a NuGet package.

The NuGet package is based on the project, so they would just get the project with the one class in it. If they want the examples they would clone the repo which would contain all projects (main class proj and examples).

@DzeryCZ
Copy link
Owner

DzeryCZ commented Jan 14, 2020

But for that we have to publish is as a NuGet package right?

Right now, I would just go for the simpiest solution - copy it around and when the refactoring (at least the main part) is done, then create the package and link it in the Examples.

Originally, I didn't expect so many changes in the class - I considered it as, more or less, feature finished. So I just copied it. I think, we can proceed with this for a little while. It's not so much hassle.
But of course as soon as the package is published, I will change the examples.

What do you think?

@erikmf12
Copy link
Author

So for someone to use the class now, they would have to clone the repo, copy the class and then add the class to their project. If they want to make changes to it, they have to copy those changes back to the repo folder, then git push.

If we create the class in a project, when they clone the repo, they would then just Add > Reference > CharacterLcdOverI2C in their existing project, and then they can using CharacterLcdOverI2C; and use the class (like it's a NuGet package). If they want to change something, they change the class where it is, and everywhere it's referenced (or to be clear where the project is referenced) will change accordingly. I think it would be easier on both the user and developer sides. This also has the benefit of being easier to push back to the repo.

Building the NuGet package is an afterthought, it's not needed for any of this. It's only needed if you want users to be able to use this class without cloning the repo.

@DzeryCZ
Copy link
Owner

DzeryCZ commented Jan 15, 2020

Hey,

maybe we don't understand each other fully. I'm sorry because I don't know that much about C# (.NET) world - Anyway, I would like to change it :)

I assume this is the docs of the feature you've mentioned: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019

So how would you proceed? Can we use any other GitHub repo as an example for up?

Can we create a structure like this:

  • Examples
    • BasicUsage
      • BasicUsage
        • App.xaml
        • ...
      • BasicUsage.sln
      • ...
    • KeyboardInput
      • KeyboardInput
        • App.xaml
        • ...
      • KeyboardInput.sln
      • ...
  • DisplayI2c
    • DisplayI2c
      • DisplayI2c.cs
      • ...
    • DisplayI2c.sln

What do you think?

@erikmf12
Copy link
Author

Here's a (large) example of one solution that has multiple projects in it.

eShopOnWeb

I think your structure looks great. We might want to mimic the example i linked and create src and example folders that then house the main project in the src folder, then one project for each example (3 projects in total) in the examples folder. Then we can just reference them and change each one independently.

@DzeryCZ
Copy link
Owner

DzeryCZ commented Jan 16, 2020

Yep, totally agree.

Let's have a structure like this:

  • examples
    • BasicUsage <- Example1 project
      • BasicUsage
        • App.xaml
        • ...
      • BasicUsage.sln
      • ...
    • KeyboardInput <- Example2 project
      • KeyboardInput
        • App.xaml
        • ...
      • KeyboardInput.sln
      • ...
  • src
    • DisplayI2c <- Main project
      • DisplayI2c.cs
      • ...
    • DisplayI2c.sln

@erikmf12
Copy link
Author

Perfect! I think that will make a huge difference.

(I'm wanting to implement a scrolling feature when I get the time!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants