Hacker News new | ask | show | jobs
Open-source framework for implementation of CRUD operations in ASP.NET Core (github.com)
43 points by korzh 1721 days ago
5 comments

What's weird is that microsoft had a fairly sophisticated crud application generator in visual studio for a while called Lightswitch but I guess it was slightly too geared to end user programming for developers to be interested, but at the same time, being in visual studio it was a non-starter for non-developers, and they ended up killing it. (And now they are instead pushing Power Apps which is part of office 365 and not based on .net)
Lightswitch was also based on Silverlight, which was a momentum killer for its adoption. It also didn't help that it was discontinued just a few years after its release, and went into 'support mode'. I believe the team developing it just got folded into other parts of the org.
Looks similar to the Django Admin Site, which also auto generates a UI based on models. When I switched my primary stack from Python/Django to ASP/MVC, the Admin Site was sorely missed.

https://docs.djangoproject.com/en/3.2/intro/tutorial07/

Yes, you are right. To some point it's similar to Django Admin.
I am waiting for some autogenerated CRUD tool like this for ages and it basically really looks awesome! Already tried it out with 200+ tables, but is there a way to get controls for collection navigation properties? E.g. to enable easy many-to-many management.

This is the one thing I miss everywhere and which prevents me to continue with my interactive encyclopedia project :(

It works already for navigation properties but not for many-to-many cases. I guess it's something we will add in future updates. could you please submit an issue about this?
Hm. What about it? These are two different tools for different purposes
I love this. The future will have more of this I hope. No more teams to fulfill requirements. Everything properly abstracted and useable by trained SMEs to assemble in days what takes months now.
I think this is a pipedream. The problem with CRUD is it's never just CRUD. It's not about the records, there's always some higher level workflow invovled. That's why there's teams, requirements, all those goodies of software development.

We've had simple solutions to CRUD apps for decades, tools like Foxpro and Access. These are great tools that do let non-developers write and distribute CRUD apps. And yet I've made most of the money in my life replacing these apps with real apps because CRUD is not the problem, workflow is. And I've yet to see one of these workflow engine things actually solve somebody's problems.

I agree. I think the secret to workflow abstraction relies in the relationships between the data. A lot can be inferred about workflow based on the direction, cardinality and type of relationship being represented.
I've seen 8 billion-dollar-in-revenues corps from the inside, they all have the same problems, just different flavors, instances of the same class. I've started to think, maybe wrongly, that the mistake made is stopping ourselves at understanding code, and not businesses. I see a bridge to be gapped, that library is one of the stepping stones.
Back in the day, I used a code generator for a DB system (proprietary language, green screen). And it was the best thing I've ever used. Myself and the SME were able to pound out an entire, pretty sophisticated and exotic, distribution system: Customers, Order Entry, Inventory (this was not your typical inventory, trust me), Debit/Credit memos, shipping, pricing, discounts, crazy tax regimens, and all the ancillary stuff that goes along with it (myriad of reports and supporting tables). We posted to an existing accounting system. We did that in less than a year of work.

You could point it at a table and get a screen and boat load of source code. Nothing amazing here. It handles both flat tables and a simple master/detail relationship. Bread and butter stuff.

Pretty much every other code generator out there is one and done. It's a "wizard", here's a table, and it dumps out a boatload of boilerplate filled in with table specifics. You run it once, then you're on your own.

This did not work that way. It was not "one and done". You used the generator constantly, all the time, over and over and over.

A simple work flow: Create a table, generate a screen. You end up with a screen with CRUD, query (very nice query), and navigation. Go back to the table, and add a field. Run the generator again and you have all of the backing code for the new column, but nothing on the screen. To add the field to the screen was straight forward. Add the field, regenerate, shazam. It's done.

See, the generator worked off of the screen spec, not the table. The original generator would create a default screen, and then generate the rest. The screen spec is the real driver. But, out of the box, it manages all of the fields in the table, it just doesn't show them all. That's why it's up to you to add the field to the screen.

It also means that if you change the table, it WON'T manage the new field until you regenerate. It's static, it's not doing this on the fly. 99% of the time this isn't a crisis.

"So what?" you say? So what indeed.

The next level is where all of the logic goes. The logic is written in to a separate file, with little snippets of code and tags identifying the code. Such as "when field XXX" changes.

This code is then merged with the generated code to make a whole. In the end, you get a blob of derivative source code that combines the generated code dictated by the tables and the screen spec, along with your custom changes. You had complete flexibility. You could outright replace entire sections of generated code with your own code (vs just adding in your changes). The whole lifecycle of the data was exposed to you. You could look at the annotated source code and see where all the tags were that you could tap into.

This was the type of tool that will give you a finished CRUD screen in an hour (with the screen reformatted, the validations, looking up reference fields, etc.), but that you could also use to make complicated programs with boatloads of logic, 1000's of lines of code, long haul core programs that just evolve over the years -- yet you never leave the tool behind.

In all my experience, even "good tools" take you to 80% and then you have to utterly abandon them. There were certainly rare occasions where I just severed a screen completely from the generator and "took over", but the vast majority were never that way. There have always been a lot of "80%" solutions out there. But all "real" projects have the heart of them living in that "20%". The 80% is easy because it's always been easy. The last 20% is hard, and the tools leave you to twist.

But this one didn't.

Mind, it helped that it was green screen. The UX was specifically limited. Modal screens with modal popups. No fussing about colors, fonts, icons, etc., the game was just trying to cram the data on to the 80x25 screen in the first place. So you get a lot of abbreviations and all of the other compromises that made computer systems so popular back in the day.

Now, there may well be a similar tool out there today. I mean, how can there not be. The modern UX environment is vastly complex, but the ones I have seen, I've only seen the 80%. I haven't found anything that works with me on the 20%.

I'd like to think it could be done with the generator creating a base class, and then your code goes in to the a subclass. That might work, but it's not quite the same. It's close. It would be a trick making the base class granular enough. But that would just likely evolve over time.

That sounds like a really awesome tool, and it's shocking more code generation tools don't take the dual file approach. XCode has finally gotten it right with their code generation for CoreData models and that's been great.

However I'm really curious how much the whole green screen aspect plays into this productivity. Programming those things really was amazing, there was so much the tools did for you and not having to deal with the bullshit of the modern web was great.

Green screens were fast to load and navigate by muscle memory keyboard shortcuts too.