Tag Info

New answers tagged

1

In the code: Validate in the setter the collection has at least one item, and raise and exception if it doesn't. In the database: Create an episode_image table. That table would have a foreign key with the image table. Unfortunately, there's no way to enforce that for every row in the parent table, there's at least one corresponding row in the child ...


0

There are a few options: Just use a regular ICollection, document the fact that it must be non-empty, and enforce this in the setter. In the database, you would have a episode_images table. This doesn't provide the compile-time safety you're seeking, but in my opinion it's the only reasonable option. You could store a FirstImage field and a OtherImages ...


2

First you have to decide if it is sufficient to have runtime safety about the number of images or if you want to have compiletime safety. Runtime safety Achieving runtime safety is quite easy. All you have to do is remove the default setter for Images and implement a setter that performs a check before saving the given ICollection<string> argument ...


-1

The underlying purpose of serialization is to ensure that data produced by one system is able to be consumed by one or more compatible systems. The easiest and most robust approach to serialization is to translate the data into a type agnostic format that maintains the structure in a simple and easy-to-consume format. For instance the most ubiquitous ...


5

Kinds of objects For purposes of our discussion, let's separate our objects into three different kinds: Business Domain logic These are the objects that get work done. They move money from one checking account to another, fulfill orders, and all of the other actions that we expect business software to take. Domain logic objects normally do not require ...


0

It sounds/looks good, I would just offer these suggestions: Might want to include a timestamp in the BaseEntity to resolve conflicts. For example, what if two people are editing the record at the same time. You can then develop conflict resolution strategy based on this value (last one in wins, etc.) Ideally every table should have a natural key to check ...


2

I'm assuming that you're using .NET for development since you mentioned MSSQL as your database but my recommendations apply to O/RMs available for other platforms as well. CRUD Soft Deletes and Auditing For your first issue, CRUD operations and filtering of "soft deletes". The O/RM itself provides a foundation that allows for more complex scenarios to be ...


1

Call delete method, which sets the delete flag and updates the object. ORMs have some impressive functionality beyound simple CRUD operations. And they still allow SQL as a fall back. If by 'the application' you mean the UI, then the real reason for the middle layer is so you don't have a 'Smart UI' design which becomes harder and harder to maintain and ...


3

Have you considered hiring your developers and then letting them decide what architecture to use? By doing this you will ensure that you aren't excluding developers from the selection process simply because they don't like the architecture you've chosen. Getting the best possible team of developers is the most important thing for ensuring your project is ...


1

You want to build a database with all the accessibility code and business logic and then hire developers to build some sort of user interface. You're taking on a lot of the development responsibility here and not giving the developers enough room to do their job. Is there some reason you don't feel you're going to hire competent people who can help you ...


3

First of all no matter what you choose you want your business logic outside your database as much as possible. There are many reasons for this, the top couple being you get tied to your database so if you need to change to Oracle or SQL Server it becomes a much harder task, SQL isn't designed to handle business logic gracefully which results in massive ...



Top 50 recent answers are included