domain-model

NHibernate many-to-many assocations making both ends as a parent by using a relationship entity in the Domain Model

泄露秘密 提交于 2020-01-22 16:56:09
问题 Entities: Team <-> TeamEmployee <-> Employee Requirements: A Team and an Employee can exist without its counterpart. In the Team-TeamEmployee relation the Team is responsible (parent) [using later a TeamRepository]. In the Employee-TeamEmployee relation the Employee is responsible (parent) [using later an EmployeeRepository]. Duplicates are not allowed. Deleting a Team deletes all Employees in the Team, if the Employee is not in another Team. Deleting an Employee deletes only a Team, if the

What does “Create a domain model via POCO classes” means?

你离开我真会死。 提交于 2020-01-14 06:06:12
问题 I have an assessment to solve. In the project solution which is given to me, there is a .csv file expected from me to process it. Here is how it looks like; asset id,file_name,mime_type,created_by,email,country,description 51df6a98-614e-40ef-8885-95ae50940058,ElitProin.aam,application/x-authorware-map,sblack0,jmitchell0@huffingtonpost.com,United States,Maecenas ut massa quis augue luctus tincidunt. Nulla mollis molestie lorem. Quisque ut erat. 279899c1-bc63-495c-94c5-57f25c881ed2

What exactly is the difference between a data mapper and a repository?

主宰稳场 提交于 2020-01-10 07:22:46
问题 Well I've been trying to find out the difference between data mapper and repository, but up to now I still have not. It seems to me that the expert programmer said "Repository is another layer of abstraction over the mapping layer where query construction code is concentrated". It seems understandable but is still somewhat very abstract. I read this article on stackoverflow before, and it just made me even more confused: How is the Data Mapper pattern different from the Repository Pattern? I

Adding code to Entity Framework 4 generated POCOs

江枫思渺然 提交于 2020-01-05 07:07:28
问题 Starting from an EF 4 entity diagram and using T4 templates one can create POCO classes that can be used inside the Domain Model. The generated code looks like this: public partial class Product { public virtual int Id { get; set; } public virtual string Name { get; set; } //and so on } Is there any elegant approach to add my own code for implementing the properties? for example, the Name setter I would like to be implemented by lowering all the characters. I would like that my code resist to

Grails: Best approach to dealing with an existing database

倾然丶 夕夏残阳落幕 提交于 2020-01-03 13:57:09
问题 I'm writing a Grails application that will be pulling data from an existing Oracle database. If I were designing this from scratch I could hold all the information in two or three domain models because logically that's how the data should be arranged. However, this is a pre-existing database that has the data I need spread across approximately 25-30 tables. So I am wondering which of the following approaches would be considered best. I don't want to do tons of extra work to take advantage of

Grails: Best approach to dealing with an existing database

故事扮演 提交于 2020-01-03 13:56:28
问题 I'm writing a Grails application that will be pulling data from an existing Oracle database. If I were designing this from scratch I could hold all the information in two or three domain models because logically that's how the data should be arranged. However, this is a pre-existing database that has the data I need spread across approximately 25-30 tables. So I am wondering which of the following approaches would be considered best. I don't want to do tons of extra work to take advantage of

Decoupling the model and input checking

一个人想着一个人 提交于 2020-01-03 03:39:27
问题 Is it a good practise to decouple input checking from a model and have it handled elsewhere, say by a controller? If so, how could this be done from an MVC or DDD standpoint? 回答1: It is a good practice to perform UI validation. E.g. if Your domain object expects date time, it is correct if UI part of application ensures it will receive from user correct string, will parse it to date time and pass it to domain object. Bad example: UI part validates if bank account has enough money for transfer

Convention-based object-graph synchronization

佐手、 提交于 2020-01-02 23:01:32
问题 I'm planning my first architecture that uses DTOs. I'm now exploring how to map the modified client-side domain objects back to the DTOs that were originally retrieved from the data service. I must map back to the original object graph, instead of instantiating a new one, in order to use WCF Data Services Client Library's change tracking feature. To put it in general terms, I need a tool that maps instances and (recursively) their sub-instances (collectively called the "source graph") to

DDD, identifying the core domain

浪子不回头ぞ 提交于 2019-12-23 10:27:06
问题 I am having difficulty in attempting to ascertain which domain within a given model can be considered the "core domain". It can be tricky especially if there are several domains which are core to the function of a business. I would like someone to outline a systematic process to single out the core domain when dealing with a system that has multiple candidates. 回答1: Core domain - the most important subdomain, which is essential for the business. Without it the business would fail. If you ever

Constraining string length in domain classes

℡╲_俬逩灬. 提交于 2019-12-21 04:38:14
问题 I have a persistence ignorant domain model that uses abstract repositories to load domain objects. The concrete implementation of my repositories (the data access layer (DAL)) uses entity framework to fetch data from a sql server database. The database has length constraints on a lot of its varchar columns. Now imagine that I have the following domain class: public class Case { public Case(int id, string text) { this.Id = id; this.Text = text; } public int Id { get; private set; } public