Giter Club home page Giter Club logo

spot-welder's Introduction

spot-welder

Formerly known as SimpleClassCreator. It has been renamed to SpotWelder since it does far more now than just creating classes. This is a WPF application for handling the creation of mundane CRUD work. This is an all around software developer tool to help aid developers in creating mundane code quickly. I am focused on reducing tedium. I will expand this into including other developer centric tools, such as performing sanity checks.

I have been working on this project on and off for a long time. I normally change it depending on my needs, but I try my best to keep it generic. I have created very basic data layers that can be used as starter code here that compliment the code that is generated.

Features

  • Solitary table or compound query to model, entity and interface
  • Serialization options to and from CSV or JSON
  • Static repository option: My implementation of an inline SQL ADO.Net repository
  • Dapper repository option
  • Taking C# code and converting it into a DTO, Model or different language.
    • This is a mostly working. It's less broken than it was. I am mostly having trouble with the UI, the code itself works just fine.
  • Creating C# object declarations from a SQL statement to help support realistic Unit Testing scenarios where writing the dummy data is a chore.

Upcoming changes

For other upcoming features check out the Issues section.

Use case

  • You were just assigned a new project and it requires that you introduce all of the scaffolding for five new tables. You just need to design the table and this project can do the rest for all five tables. This is not a regeneration of your entire solution, it is only for those five tables.
  • For some reason your existing ORM is choking real bad at executing properly formed SQL, Linq is failing you here and you need to control your SQL. Generate a static repository for your target table and you are back in business. Only keep the code you need from what was generated.
  • You need to create a DTO from an existing object or table and writing that code by hand is joyless, just generate it.

Why I created this tool originally

  • I had to create a data layer for a 130 column table in VB dot net. I refused to write it by hand and spent time writing the first version of this tool to do it for me. Work smart, not hard.
  • In a past role, I saved my team weeks of work by automatically creating DTOs for every entity in our domain.

What this project is not

This project is not meant to be a full template driven code generator. I think of it as a spot welder for getting starter code written quickly when you need to introduce new pipelines for new tables that have been introduced into your domain. If you need a full template driven solution consider using CodeSmith Tools Generator. I have used this in the past for setting a code generation standard when multiple people need to work on a domain as is typical of software development. This product allows you to control all of your layers at a very granular level in any language. It does not just have to be C#, I have built SQL and JavaScript using this tool as there are no restrictions on that. I am not affiliated with or endorsed by CodeSmith Tools, I just really like their tool and I own a personal copy of it which I use for a larger project.

spot-welder's People

Contributors

dyslexicanaboko avatar

Watchers

 avatar

spot-welder's Issues

Optional connection string builder

I always forget the damn syntax for connection strings so a simple builder of some kind would be helpful. Little pop up window that can provide the string if desired, not a requirement.

Create new About window

Replace the older Windows Forms based About window with a more unique and informative windows about my application. I might be able to make it a reusable window since a lot of the information is exactly the same.

  • Provide a link for the repository
  • Provide a link to my website
  • Provide a link to my about page
  • Provide a link to my LinkedIn
  • Provide more detailed information about the application

DTO Maker dynamic code fails for complex types

The DTO Maker is failing when there are complex objects. Meaning you have a class that references another class. As in not stock types supplied by the framework. I am not sure how to deal with this yet because these classes are interpreted on the fly, so it's a chicken and egg problem.

Example:

public class Foo
{
    public int Prop1 { get; set; }
    public Bar Prop2 { get; set; } //This will bomb
}

public class Bar
{
    public string Text { get; set; }
}

Postgres support

Add in support for Postgres databases. This will be challenging because unfortunately Postgres query syntax can be far different than tSQL in regards to formatting. It largely follows the same ideas, but it essentially punishes you for not using lower snake case naming conventions by wrapping everything in soft quotes.

  1. Add connectivity support for Postgres.
  2. Support lower snake case syntax.
    1. Ex: SELECT my_id FROM public.my_table
  3. Support qualified table and column names. That is, table and column names wrapped in soft quotes.
    1. Ex: SELECT "MyId" FROM public."MyTable"

Other problems will include:

  • Mapping Postgres types to a System.Data.DataTable. I don't know that there will be equivalencies for everything since Postgres has so much to offer.

Create installer

Create installer like I did in the Consuela repository. Details TBD.

Allow saving of multiple/all files

When multiple files are generated and you just want the default names it's easier to just hit one save button instead of N buttons. I want a parent window that is used to contain all results like a browser window does with its tabs.

  1. On an aside: The tooltip for the save icon reads "Copy to clipboard" Taken care of as part of dyslexicanaboko/simple-class-creator#22
  2. Easy way to close all results windows.
  3. The cloning service file is not saved with the appropriate suffix. No longer relevant.

Delimited string data to object option

There are times where I just need to deserialize a CSV of string data into an object. It would be nice to automatically create this method even if the indices aren't absolutely correct. Way easier to have it written for me and then I can rearrange the indices myself.

Convert whole project to latest dot net

  • Not sure when I will have a chance to do this, so leaving it open ended. As of 02/04/2024 the latest version of dot net is 8.
  • Might need to move repositories, or I can just do a version two in-place until I can retire this older code. It's going to be an exact copy to start so I don't know if I care.
  • I want to rename the project and its namespaces. It really might make sense to just move to a new repository all together since the names won't even match at that point.

Generate unit test fixture for an object

Setting up a Unit Test Fixture the first time is a pain. It would be nice to have a way to just automatically setup the fixture with all of its dependencies mocked using FakeItEasy. The pattern is always the same.

public class SomeServiceTests
{
    private readonly IDependency _dependency;
    private SomeService _sut;

    public SomeServiceTests()
    {
        _dependency = A.Fake<IDependency>();
        _sut = new SomeService(_dependency);
    }

   //Tests below
}

By using reflection, we can find out what the dependencies are and just create a boiler plate class. The class doesn't even have to be perfect, just enough to get started. This helps especially when a class has too many dependencies.

Add in basic logger

Add in the basic Serilog stack I use so I can start logging errors that may be occurring without my knowledge and to avoid crashing the application.

Keyboard support for Results windows

I want keyboard support for the Results Windows. This includes the single result and parent-tabbed windows:

  1. Support for Ctrl + S, to save THIS file.
  2. Support for Ctrl + Shift + S, to save ALL files.
  3. Double check that the tooltips read correctly.

API layer generation option

I need to be able to generate basic CRUD API layers to complete the n-tier pipeline. This will require a few things:

  1. Web API controller - contains the basic CRUD endpoints for the target resource.
  2. Mapper - At minimum, a way to convert Entity to Model/Interface and to handle the Create and Update models. Contents does not necessarily have to make sense yet.
    1. Problem is I have a base method that I need for the Mapper and not sure how to handle that yet.

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.