Search Results

Search found 7 results on 1 pages for 'ciscoheat'.

Page 1/1 | 1 

  • Can immutable be a memory hog?

    - by ciscoheat
    Let's say we have a memory-intensive class like an Image, with chainable methods like Resize() and ConvertTo(). If this class is immutable, won't it take a huge amount of memory when I start doing things like i.Resize(500, 800).Rotate(90).ConvertTo(Gif), compared to a mutable one which modifies itself? How to handle a situation like this in a functional language?

    Read the article

  • Drupal join on taxonomy terms

    - by ciscoheat
    I have a Drupal setup like this: Content type: Apartments Vocabulary: Areas, that can be used with Apartments. Content type: User profile, with a Content Taxonomy Field for Areas so users can select what areas they are interested in. I would like a view that shows all the user profiles that matches the apartments in their area. A "User profile <- Areas <- Apartments" join in other words. I've been mucking around with the views interface for a while but it's not clear to me how the relations can be setup to achieve this. Can someone give me a hint? In case this cannot be easily solved with views, what is a good way of doing it otherwise? Thanks for your help.

    Read the article

  • User control attributes at design-time

    - by ciscoheat
    I'm testing a simple User Control in Visual Studio 2008: A Panel named Wrapper with some controls inside. Can Visual Studio handle this at design time? public partial class TestControl : System.Web.UI.UserControl { [Description("Css class of the div around the control.")] [CssClassProperty] public string CssClass { get { return Wrapper.CssClass; } set { Wrapper.CssClass = value; } } } When setting the CssClass property, it doesn't update the css of the Panel at design time. Am I hoping for too much?

    Read the article

  • A good class structure for cleaning and using input?

    - by ciscoheat
    I want to be helpful to the users of a system, so I'll clean up the input a bit before testing if it can be used. So I have a flow like this: Input: aa12345b Clean input somehow: 12345 Test if clean input is valid Use input if valid Now I want to do this in a beautiful OO-fashion (IoC, interfaces, testable, no statics, you know). Any ideas how to organize a class structure for this? Is it good to have a Cleaner and a Parser/Validator class separately, or put them as methods in the data class itself? Thanks for any help or discussion about this, and extra thanks if the answer is in C#!

    Read the article

  • DCI: How to implement Context with Dependency Injection?

    - by ciscoheat
    Most examples of a DCI Context are implemented as a Command pattern. When using Dependency Injection though, it's useful to have the dependencies injected in the constructor and send the parameters into the executing method. Compare the Command pattern class: public class SomeContext { private readonly SomeRole _someRole; private readonly IRepository<User> _userRepository; // Everything goes into the constructor for a true encapsuled command. public SomeContext(SomeRole someRole, IRepository<User> userRepository) { _someRole = someRole; _userRepository = userRepository; } public void Execute() { _someRole.DoStuff(_userRepository); } } With the Dependency injected class: public class SomeContext { private readonly IRepository<User> _userRepository; // Only what can be injected using the DI provider. public SomeContext(IRepository<User> userRepository) { _userRepository = userRepository; } // Parameters from the executing method public void Execute(SomeRole someRole) { someRole.DoStuff(_userRepository); } } The last one seems a bit nicer, but I've never seen it implemented like this so I'm curious if there are any things to consider.

    Read the article

  • DDD: Where to create entity objects?

    - by ciscoheat
    I have three entities that must interact: User, SupportTicketand PhoneConversation. When someone calls in requesting help, the User should have a SupportTicket assigned to him, with a PhoneConversation assigned to the Ticked describing the call. My question is: In what entity should I put the method CreatePhoneSupportTicket() that creates a new SupportTicket and a PhoneConversation, relates them to each other and finally relates the SupportTicket to the User? I'm guessing it can't be on the user because that would violate the SRP (the user does a few more things). But the method itself does more than one thing, it should create both a SupportTicket and a PhoneConversation. Is this a situation when a Service is a better solution then putting methods on entities? Thanks for your help!

    Read the article

1