abstraction

How should I properly implement the core Clojure interfaces?

喜欢而已 提交于 2020-01-04 02:35:13
问题 If I'm implementing some data structure in Clojure using deftype , how should I decide which of the core Clojure interfaces to implement? I was unable to find a comprehensive guide to the various Clojure interfaces; in fact, the only relevant piece of information I was able to find was this question, which is very limited in scope. What I'm looking for is a list of each of the core Clojure interfaces, with a brief description of what it is and when you should implement it (or if you should

Abstraction away from CSS

扶醉桌前 提交于 2020-01-01 04:12:14
问题 Let me make something quite clear. I. Hate . CSS. It is a never-ending nightmare. Every minor layout change feels like a hack. Solutions to problems seem to often involve jiggering numbers around like some chef trying to work out exactly how much nutmeg to put in his soon-to-be famous rice pudding. Then comes the multiple browser issue, the multiple resolution issues.. .. to cut a long story short, it's a pain. A PITA, if you will. Many frameworks seek to abstract away from HTML (custom tags,

Providing array or list of class objects via WCF

三世轮回 提交于 2019-12-31 03:15:11
问题 Any example of WCF client server providing of List or Array of custom class objects would help me! But here is what I have got so far: Here is my class system I want to provide namespace NEN_Server.FS { [Serializable()] public class XFS { private List<NFS> files; public XFS() { files = new List<NFS>(); } public List<NFS> Files { get { return files; } set { files = value; } } } } where NFS is namespace NEN_FS { public interface INFS : IEquatable<NFS> { string Path { get; set; } } [Serializable

How can you pass a List<objects that implement an interface> to a method?

北慕城南 提交于 2019-12-30 03:49:09
问题 I have a servlet that, passed on query params, gets a list of objects from the DAO, turns the list into JSON, and sends it back in the response. Every list is made of objects that have a method: public String getAsJson(){...} And the servlet has a bunch of mostly indentical methods that look like: private String getUserListAsJson() { List<User> userList = this.dao.getUsers(); StringBuilder builder = new StringBuilder(); builder.append('['); // loops over the list appending the value of each

Wrapping DbSet<TEntity> with a custom DbSet/IDbSet?

隐身守侯 提交于 2019-12-29 14:21:31
问题 First off, I think this is somewhat ridiculous to do but the other members of my team insist upon it and I can't come up with a good argument against it other than "I think it's dumb"... What we're trying to do is create a completely abstract data layer and then have various implementations of that data layer. Simple enough, right? Enter Entity Framework 4.1... Our end goal here is that the programmers (I do my best to stay only on the data layer) never want to have to be exposed to the

What is Google's Dremel? How is it different from Mapreduce?

二次信任 提交于 2019-12-28 03:26:06
问题 Google's Dremel is described here. What's the difference between Dremel and Mapreduce? 回答1: Check this article out. Dremel is the what the future of hive should (and will) be. The major issue of MapReduce and solutions on top of it, like Pig, Hive etc, is that they have an inherent latency between running the job and getting the answer. Dremel uses a totally novel approach (came out in 2010 in that paper by google) which... ...uses a novel query execution engine based on aggregator trees... .

What is abstraction? [closed]

懵懂的女人 提交于 2019-12-28 01:09:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I see abstraction in processes. I see abstraction in data. I see that abstraction is losing the unimportant details. I see that abstraction is giving a group of elements a name and treating them as one unit. (But

C# Custom Object Validation Design

老子叫甜甜 提交于 2019-12-24 21:46:33
问题 I currently have to validate custom Field Objects for my application. Simply put, each Field object consists of information about the validation for the field, as well as the value of the field. I am validating fields in bulk, so currently, I have a validation class, that has a method for each validation. For required fields, it looks something like this: private void RequiredFields() { foreach (Field field in allFields) { if ((field.Required == true) && (field.Value == string.Empty)) { field

Objective-C: how to prevent abstraction leaks

三世轮回 提交于 2019-12-23 11:44:47
问题 I gather that in Objective-C I must declare instance variables as part of the interface of my class even if these variables are implementation details and have private access. In "subjective" C, I can declare a variable in my .c file and it is not visible outside of that compilation unit. I can declare it in the corresponding .h file, and then anyone who links in that compilation unit can see the variable. I wonder if there is an equivalent choice in Objective-C, or if I must indeed declare

Is it possible to create a Component abstraction on Angular 2?

二次信任 提交于 2019-12-23 07:00:09
问题 I want to create a AbstractComponent with initial behavior while being able to override it on child when needed, is it possible? Is it a good practice? Should look more or less like that: export abstract class AbstractComponent implements OnInit { constructor(authService: AuthService, router: Router) {} ngOnInit() { if (authService.userNotLoggedInAnymore()) { router.navigate(['Login']); } } ... } 回答1: Yes, just extend that class with the real @Component and call super() in the methods you