Tag Info

New answers tagged

1

By all means, the second option you said is the better choice: 2) Client's connect to a web service which runs the sql query and then returns the data. There are a lot of reasons as to why the DB access should be shunted away from the client, but here's a list of some of the more important considerations: Security Using a web service allows you to ...


2

The first question you need to answer is whether you intend to create a truly generic data access framework, or if you want it tailored to the particular project you're working on. A generic framework has the benefit of being portable and fairly loosely coupled to the underlying DB + schema, but at the cost of pushing schema level information further up in ...


8

LLVM backend is the primary sane way of doing this. If you lower LLVM IR to assembly or microcode, you can roll from there and just use the numerous LLVM frontends to convert higher languages like C++ into LLVM IR. In other words, LLVM was explicitly designed to support this scenario. The full stack goes like this: Frontend (e.g. Clang for C and C++) - ...


1

I not sure how this is a problem. You have a screenshot. Who cares what the label is on the button? You don't change the layout of your application that drastically for different locales, right? You should know what the screen/button is. It then becomes pretty trivial to use your debugging utils to identify what is the source of the widget in code. From ...


0

I'd say it depends on the application and its users. If its an internal company app localized to an office location talking to the db directly is better, as building a service between the app and db makes the building of your software more expensive for no real gain. If there are physically disconnected branch locations or your app is available outside of ...


0

Many ejabberd and mongooseIm users have faced this problem. They have managed to cover up for most of the essential features, but some specification like file transfers,location tracking etc dont come out of the box with erlang based chat servers like ejabberd and mongooseIm. But the makers have provided users with the luxury of extending ejabberd's ...


0

Maybe my blog article can help you Basicly it uses a template engine to render the backend Commands and Queries into java script objects. In this case .NET T4 templates, but maybe it can give you some ideas. You benefit from contract safty and code completion during design time


0

You can't have both without restricting your user: allowing users to create the URLs freely AND having collision-free URLs for each module. If you want to allow users to create URLs, you may check if the entered URL is already in use through doing self-queries but that would still result in having the user restructure the URL catalogue in case there has ...


0

You may take some inspiration from the ODATA protocol as a variation to your option 1. It has so called query options one of which is $expand that takes the value of the related resource to return. The $expand system query option specifies the related resources to be included in line with retrieved resources. The request below returns people with navigation ...


0

You can also do it in one call by embedding authors inside posts. JSON Hypertext Application Language describes how to do this, see https://tools.ietf.org/html/draft-kelly-json-hal-06 e.g. (modified copy from the doc): { "_links": { "self": { "href": "/posts" }, "next": { "href": "/posts?page=2" }, "find": { "href": ...


1

That's, what links are for: E.g. requesting the first post via GET http://example.com/posts/1 { "id": "1", "author": { "nickname": "me" }, "links": [ { "rel": "self", "href": "http://example.com/posts/1" }, { "rel": "author", "href": ...


1

You could do something similar to what discogs do in their API, http://www.discogs.com/developers/#page:database,header:database-release. When requesting a release /releases/{release_id} the response also includes a subset of artist data, extract from the response body: { "title": "Never Gonna Give You Up", "id": 249504, "artists": [ ...


1

The main drawback is a loss of clarity. For instance: x.foo(); x.bar(); x.baz(); Since none of those statements return a value (or if they do, it's been ignored), they can only be useful if they produce side effects. Contrast that to: x.foo() .bar() .baz(); First, it's not clear that bar and baz operate on objects of the same type as x, unless you ...


0

Consider all the stylistic elements of programming languages (as opposed to hand-coding machine language), and it weakens the "semantics not convenience" argument. A whole lot of what we do as engineers is providing convenience around semantics.


3

Yes, there are drawbacks Code that is easy to read is good, but also beware of what the code communicates as well. When an object's methods always return the object, it communicates a couple of things: I require advanced configuration that isn't necessarily obvious in which order things should be set or configured Each subsequent method call builds on the ...


1

You will probably need three tables: User tables with a primary key and the usual first name, last name etc Roles table with roles specific to your application (eg Administrator, Power User, User, read only) UserRoles with the user primary key, roles primary key, date created, date last modified, enabled (NUMBER (1) default 1 with check constraint that this ...


2

Your problem has striking parallels to functional programming: Monads, Functors, and composing functions. Your composability requirements essentially states that each operation must be a function that takes a stream and returns a stream: operation : Stream -> Stream Most functions will not be expressed in terms of whole streams but rather single frames ...


0

For flexibility, DO NOT do initialisation in constructors. For simplicity, i.e. if you can afford it and are sure it will not cause you headaches later, DO initialisation in constructors (RAII). Then you can make the usual safe RAII assumptions about (monolithic?) deallocations. All programming relies on correct ordering of events. There is nothing ...


0

From a different perspective, it is my experience that most programmers/developers do not plan for success and the "prototype" is almost always becomes Release 1.0. I have first hand experience with 4 separate original products in which the classy, sexy, and highly functional front-end (basically the UI) resulted in wide-spread user adoption and enthusiasm. ...


2

Typically a Service Bus is used for routing and connectivity. I would use a Service Bus where I need to have multiple changing subscribers to a particular service, or routing of messages changed depending on some event etc. In your example, where it is literally a point to point connection, then a Service Bus is not really going to be relevant. What might ...


1

The most efficient way would be for the client application that is responsible for sending the email to query the DB at startup and remember the next meeting time. It would sleep until 3 hours before this time, then wake up and send the email. However, the application would also have to be informed of changes to the meeting schedule - either meetings that ...


5

I'm not sure that I see what "huge impact on the database" a process would have that polled the database every 5 minutes. Presumably, you have some sort of table that stores your meetings and their start times. It should be relatively easy to index the column that stores the start time and to write a query that looks for all the meetings set to start ...


1

You're basically using a mediator pattern. To start, be aware that you might be overusing it if you're using it everywhere. Event driven programs can be harder to debug or to even reliably predict behavior, so you'll want to use this pattern only when there's an actual pain caused by the normal coupling. For a modal I very much doubt I'd use it. With that ...


2

The author makes the distinction between what is in the "board game" or not with the following example: eBay the website and eBay the board game both need buyers, sellers, items, and bids – but only eBay the website needs users, sessions, cookies, login/logout etc. See how he mentions "buyers" and "sellers"? These are just different names for "users", ...


2

expose the existing complex data model without introducing DTO classes One major flaw of this approach is that of coupling data access layer with API. It can go very bad very quickly if those models are used elsewhere except API. I currently work on a project where both web interface and JSON API (kind of REST, but not quite) use the same Hibernate ...


4

The key in understanding MVC lies in the separation of the responsibilities, as MVC is simply SRP applied to UI code. It separates what data has to be displayed, from how to display it, from how to handle screen events. But an important (and often missed) detail of the original definition of MVC is that it was designed for a far more granular level. For ...


0

The key to Alan Kay's view is the reason why a message is sent. When an object of class A sends a message to an object of class B because A wants B to do something specific, that isn't OO (according to Kay's vision.) If A is sending the message to inform B that something has happened (rather than telling it to do something,) that is OO. A good example of ...


0

Now where does the logging go? Second, I need to send a mail to the user. where should the call go? I would recommend Domain Events. Create two events: UserBanAttemptedEvent and UserBannedEvent (note the past time). The logic for logging and email notifying is going inside event handlers, create two handlers UserBanAttemptedEventHandler and ...


1

... intuitive for developers to use, so the code itself explains and forces developers to use it in certain way... It's a myth that OO bits can be intuitive unless they are trivial. like the most fundamental framework elements. LOB objects are the opposite of that. They need good documentation and examples demonstrating all the functionality you'd hope ...


1

The way I usually do this is based on a full update using a structured representation of the record. Some would call this a Data Transfer Object (DTO). Something like: { # book 'id': 123, 'title': 'The Art of Computer Programming', 'authors': [ { 'id': 456, 'name': 'Donald Knuth' } ] } In the list of authors, if the author ...


2

I will try to answer with the info you gave me. You wrote I need to: detect new Authors, so I can insert them detect removed Authors, so I can remove them assume everything else is updated. So I think that your aproach is too CRUD for DDD and aggregate roots. My 2 cents your business method is something like Update(Book) and the ...


2

If authors are Value Objects, you can easily re-create the whole list each time because only their value matters, you don't have to relate them to identified objects. This might be at the cost of losing business intent though, since you don't capture what the user precisely wants to do. If they are Entities, I suggest sending granular commands to Book -- ...


1

I recommend you install a continuous integration server, hook it up to your code repository and a snapshot/release repository and automate your builds. This will have a number of advantages: Every component will be versioned when it is released. This includes low-level libraries as well as your final products. Every code commit will trigger a snapshot ...


3

This post makes an interesting point about your question. In a more practical way, if you have 3 components: 2 Consumers: a Front-End and a Mobile App 1 API provider: a Back-End You could use the typical M.m.p (Major.minor.patch) versioning scheme for each but, on your Back-End url you could put something as http://youhost/M.m/resourceURI. As you ...


1

First, I'm lets start off by framing the problem a little differently. You've asked which pieces of software you need to "version". Version is an overloaded term in CS, and could mean about 100 different things. The primary things I would look at is: Version Control - Version control is a configuration management tool that helps you keep track of snapshots ...


6

As you can't control when the mobile apps will be updated to a new release, you need to version at least your REST API. If you don't it will be impossible to make backwards-incompatible changes to that interface. Besides the REST API, it is a good idea to version also the other communication interfaces that go over a network interface. That way, you are ...



Top 50 recent answers are included