@derobert Boy the online reviews are hating on the new Amazon fire.... now I am wondering if I made a mistake orderfing one, but... only $99. And there are always haters.
Certainly anything built in the last 20 or 30 years.
They must think that they are a selling point.
Or it must give them some legal advantages of control during the sales and transition period, but assuming it is self serving is just because I am a cynical old bastard.
I have heard of ORMs as a concept, but they almost always seem to be more work than they save, unless they are really trivilally simple, which is how I like them.
And I know MVC is a pattern, not a particular product.
And I still think calling things "patterns' is new hi falutin programmer talk for old stuff.
@SAJ14SAJ Catalyst is pretty lightweight. It handles interaction with the web server & basic web "API" stuff (e.g., decoding query parameters, POST parameters, character set conversions). Then it handles determining which controller to pass a request to.
It also provides various things (e.g., a per-request variable store) and has plugins to give all kinds of things (e.g., sessions, easy access to memcache, authentication & access control)
I am not a big adherent of MVC. I have always found view very helpful, but the distinction between model and controller becomes hopelessly complex in the real world.
@derobert I don't know what any of that has to do with the MVC paradigm.
Yeah, most of those things exist in my own stack..... I get a lot from Service Stack which is a .NET open source (or used to be, I hope someone forks and maintains the free version). The rest I wrote myself.
But I have so, far, been able to maintain absolutely no server side state other than an authentication token.
At least state that doesn't get committed to the db, anyway.
The trick there, and it is not easy, you must adopt it 100% for it to really work, is to not have any JavaScript in the HTML. It all has to be separate. But yes, I agree.
@SAJ14SAJ yeah, but you can do session pinning on load balancers. That's a fairly solved problem. Or store your session data in memcache.
@SAJ14SAJ Well, it annoys me that the knowledge of what a field is called winds up in two, if not three, places. The controller needs to know it, the HTML needs to know it, if you have JavaScript, it needs to know it. And it often matches the model's name too.
And sometimes the CSS...
Same applies to the type of data. Or the validation.
It may be a solved problem, but you have never met the disfunction of having Dell manage the technical services. So anything I can do without them is preferred.
@derobert The way I wrote my stack makes that go away.
I have componts I wrote that become the UI when they render into HTML, and also handle all the data mangling between client and server in the same code.
@SAJ14SAJ Ah, you wrote yourself a form manager? I used one on the last big Catalyst app I did (at work). I was going to try a new one for this, but decided it'd take a while to learn it...
And I've promised myself I will not write the next Perl form manager (there are already several) until I at least look at the ones people have already done...
I don't know if I would be so fancy as to call it a form manager.
I think of it as an HTML rendererer.
That is smart enough to receive back the post with the exact same code, so the code object that sends the form and the one that receives it back are the same, usually.
The existing Perl ones range from ones that just help generating HTML elements; through ones that add a validation framework on top of that; through ones that integrate with the ORM to fully build the form, load the values, and save new ones; and even ones that abstract away the fact that a web app is made of individual HTTP requests...
It just renders HTML and receives back the values and puts them in POCOs.
YEs, but some of my HTML elements are..... more widget like. Like one that takes a sequence of data, and a line renderer, and then renders paged navigation.
Very useful for master - detail pages.
Another will render any sequence into a pretty HTML table.
Ah. So you've already gone beyond HTML elements. The next step is to add declarative validation ("this field must be an integer", "this field must be alphanumeric, length greater than 6").
@derobert I agree, and if this was an open source project anyone else would ever see or use. BUt it has ONE developer, and he is curmudgeonly. I don't have the time to research the common subset and validate it.
I'm personally a fan of, if its reasonably possible to express a constraint in the DB, do so. I wish pgsql supported more CHECK constraints than it does.
Sure. But if you're going to enforce a heightened constraint, you have to fix the data, regardless of where you enforce it. Unless you only plan to enforce it for new data.
In the kind of work I do, you almost always can only enforce for new data.
But the way I deal with the problem, and I am very aware this is not right for many or even most application environments, is that each of my business objects or modules has a Manager object (you would probably call it the Model) in C# that manages the busienss rules, and treats the SQL side as a persistence target only.
So I just want to send the whole bloody file to the server once, and not round trip for load, compare, update, read next time.
@derobert I know that you are a #1 postgres fanboy :-) But my options are SQL server, SQL Server, SQL server, or, if I am feeling really, really wacky, SQL server.
Because that is what I have dev licences for in our EA, and what Dell will support.
Since I am not going to do ORacle, nor pay for it.
Yeah, one of the features I really like in C# is that you can at the calling site choose to name the parameters, and then the positional order is no longer important.
Perl strings are "string" (interpolates $var, \n, etc.); 'string' (does not). Then there are the q and qq strings, which allow any delimiter (q does not interpolate, qq does). E.g., you can use braces: q{string}. There are /string/ (regex) strings as well, and qx which is like qq but marks a regex.
when you use braces or parentheses for your q/qq/qr delimiter, it even makes them pair right. E.g., q{string{inside}still string} works
I've tried Rails before, didn't much care for it. With what I was trying it on before, it was a problem because it insisted that the DB shall be layed out like X: the fields named so-and-so, and the tables this-and-that, etc. That wasn't going to happen, because the database already existed and other apps use it.
Was a constant fight to try and override all of that.
In this case, I suppose it would have been fine—the db is only for this one app
@derobert In almost every circumstance I have needed to make PDFs, I just send it through a PDF printer, then pick up the file. Ugly horrible cheat, but there you have it.
It takes documents in any number of formats, and converts them to whatever format the printer actually needs. You can give it a blob in the right format for the printer and ask it to pass it through, but normally you don't.
then the second people wanted to start connecting cheaper printers, well, it had to gain the ability to translate PostScript to whatever the printer spoke
I used to want an Epson-MX80 so badly. Along with the HP LaserJet III probably one of the two all-best for the era printers of all time in the PC universe.
Interesting. The "wet messy dough" question is now on the hot list. Weird, so far the question has 2 answers with one upvote apiece and 2 upvotes for the question itself. Is it that "wet and messy" sounds sexy? That seems to be one of the qualities that gets questions on to the hot list.
When I do buy wine, I tend to get the 4-packs too, since I won't drink the rest of the bottle. I could give the rest of the bottle to my neighbor, but that's problematic itself.
Today's Easter, isn't it? No wonder it's so dead around here.