Search Results

Search found 13259 results on 531 pages for 'design'.

Page 169/531 | < Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >

  • OOP App Architecture: Which layer does a lazy loader sit in?

    - by JW
    I am planning the implemention an Inheritance Mapper pattern for an application component http://martinfowler.com/eaaCatalog/inheritanceMappers.html One feature it needs to have is for a domain object to reference a large list of aggreageted items (10,000 other domain objects) So I need some kind of lazy loading collection to be passed out of the aggregate root domain object to other domain objects. To keep my (php) model scripts organised i am storing them in two folders: MyComponent\ controllers\ models\ domain\ <- domain objects, DDD repository, DDD factory daccess\ <- PoEAA data mappers, SQL queries etc views\ But now I am racking my brains wondering where my lazy loading collection sits. Any suggestions / justifications for putting it in one place over another another? DDD = Domain Driven Design Patterns, Eric Evans - book PoEAA = Patterns of Application Architecture Patterns, Martin Fowler - book

    Read the article

  • C# Running several tasks at different intervals

    - by Nir
    A design question: I'd like to build a Windows service that executes different commands at different intervals. For simplicity's sake, let's say I want to run some batch files. The input it gets is a list of files and the intervals at which to execute. For example: a.bat - 4 minutes b.bat - 1 minute c.bat - 1 minute d.bat - 2 minutes I was thinking about sorting them according to intervals, and then setting a timer for each of the intervals. I'm not sure this is the best solution and I'd be happy to hear some feedbacks. Thanks!

    Read the article

  • Designing constructors around type erasure in Java

    - by Internet Friend
    Yesterday, I was designing a Java class which I wanted to be initalized with Lists of various generic types: TheClass(List<String> list) { ... } TheClass(List<OtherType> list) { ... } This will not compile, as the constructors have the same erasure. I just went with factory methods differentiated by their names instead: public static TheClass createWithStrings(List<String> list) public static TheClass createWithOtherTypes(List<OtherType> list) This is less than optimal, as there isn't a single obvious location where all the different options for creating instances are available. I tried to search for better design ideas, but found surprisingly few results. What other patterns exist for designing around this problem?

    Read the article

  • Decorator Pattern - Multiple wrappers or quantity property?

    - by Jiminizer
    I'm making use of the decorator pattern for one of the first times, as part of a Uni project. As far as I can see, the pattern seems to be meant more for adding functionality in a modular manner, however we've been taught it with uses such as a coffee or pizza maker, where the object has modular components that are added - changing properties rather than behaviour. I'm trying to make the most of both uses, however I've come up with a question. In the example in the book we're using (Head First Design Patterns), the pattern is used in a coffee shop creating different coffees. So, for example, milk, froth, sugar, sprinkles are all decorators. How would you implement a system that used the same decorator multiple times (for example, a coffee with two sugars)? Would you rewrap the coffee, or give sugar a quantity property? Or (as i'm starting to suspect) would this never be an issue as the pattern isn't designed to be used this way?

    Read the article

  • Write a network simulator for fun

    - by Jono
    I want to write my own network simulator, for fun and for personal challenge. I hope to learn both new programming techniques, and a little bit more about networking. Previous object-oriented attempts ended very quickly, but I've recently downloaded and played with Microsoft's Axum (a new version was released today) and their Concurrency and Co-ordination Runtime. As I come from a very OO dominant background, I had never heard of Actor-oriented programming before; now it seems I've had my head in the sand until Scala and F# brought the paradigm to me. My questions are: a) is actor-oriented programming a better choice than object-oriented programming for this task, and if so b) where is a good place to start learning actor-oriented design?

    Read the article

  • How to create a language these days?

    - by Mike
    I need to get around to writing that programming language I've been meaning to write. How do you kids do it these days? I've been out of the loop for over a decade; are you doing it any differently now than we did back in the pre-internet, pre-windows days? You know, back when "real" coders coded in C, used the command line, and quibbled over which shell was superior? Just to clarify, I mean, not how do you DESIGN a language (that I can figure out fairly easily) but how do you build the compiler and standard libraries and so forth? What tools do you kids use these days?

    Read the article

  • Learning to write organized and modular programs (C++)

    - by Peter
    Hi All, I'm a computer science student, and I'm just starting to write relatively larger programs for my coursework (between 750 - 1500 lines). Up until now, it's been possible to get by with any reasonable level of modularization and object oriented design. However, now that I'm writing more complex code for my assignments I'd like to learn to write better code. Can anyone point me in the direction of some resources for learning about what sort of things to look for when designing your program's architecture so that you can make it as modularized as possible? Thank you for any help. Best, Peter

    Read the article

  • How to solve the "Growing If Statement" problem?

    - by Achilles
    I've been doing some reading about design patterns and wanted some perspective. Consider the following: Dim objGruntWorker as IGruntWorker if SomeCriteria then objGruntWorker = new GoFor() else if SomeOtherCriteria then objGruntWorker = new Newb() else if SomeCriteriaAndTheKitchenSink then objGruntWorker = new CubeRat() end if objGruntWorker.GetBreakfast() system.threading.thread.sleep(GetMilliSecondsFromHours(4)) objGruntWorker.GetLunch() The above code grows each time a new Criteria arises. I've seen code like this all over the place and in ignorance wrote some of it myself. How should this be solved? Does this kind of anti-pattern have a more "formal" name? Thanks for your help!

    Read the article

  • Inheritance vs specific types in Financial Modelling for cashflows

    - by BlueTrin
    Hello, I have to program some financial applications where I have to represent a schedule of flows. The flows can be of 3 types: - fee flow (just a lump payment at some date) - floating rate flow (the flow is dependant of an interest rate to be determined at a later date) - fixed rate flow (the flow is dependant of an interest rate determined when the deal is done) I need to keep the whole information and I need to represent a schedule of these flows. Originally I wanted to use inheritance and create three classes FeeFlow, FloatingFlow, FixedFlow all inheriting from ICashFlow and implement some method GetFlowType() returning an enum then I could dynamic_cast the object to the correct type. That would allow me to have only one vector to represent my schedule. What do you think of this design, should I rather use three vectors vector, vector and vector to avoid the dynamic casts ?

    Read the article

  • C# DDD Populate Immutable Objects

    - by Russel
    Hi I have a immutable Customer class in my domain assembly. It contains the following GET properties : id, firstname and lastname. I have a CustomerRepository class in my persistence assembly. In turn, this CustomerRepository class should populate and return a Customer object using a remote web-serivce. My Customer class contains no setter properties and it contains a private constructor. The reason - I dont want the UI developer to get the wrong idea - He should not be able to create or change a Customer object. My question: How do I get my CustomerRepository to populate my Customer object. Reflection? Or should I sacrifice my design and enable a public constructor for constructing the customer object?

    Read the article

  • Should I create protected constructor for my singleton classes?

    - by Vijay Shanker
    By design, in Singleton pattern the constructor should be marked private and provide a creational method retuning the private static member of the same type instance. I have created my singleton classes like this only. public class SingletonPattern {// singleton class private static SingletonPattern pattern = new SingletonPattern(); private SingletonPattern() { } public static SingletonPattern getInstance() { return pattern; } } Now, I have got to extend a singleton class to add new behaviors. But the private constructor is not letting be define the child class. I was thinking to change the default constructor to protected constructor for the singleton base class. What can be problems, if I define my constructors to be protected? Looking for expert views....

    Read the article

  • Is it okay if my ViewModel 'creates' bindable user controls for my View?

    - by j0rd4n
    I have an entry-point View with a tab control. Each tab is going to have a user control embedded within it. Each embedded view inherits from the same base class and will need to be updated as a key field on the entry-point view is updated. I'm thinking the easiest way to design this page is to have the entry-point ViewModel create and expose a collection of the tabbed views so the entry-point View can just bind to the user control elements using a DataTemplate on the tab control. Is it okay for a ViewModel to instantiate and provide UI elements for its View?

    Read the article

  • Transfer of directory structure over network

    - by singh
    I am designing a remote CD/DVD burner to address hardware constraints on my machine. My design works like this: (analogous to a network printer) Unix-based machine (acts as server) hosts a burner. Windows-based machine acts as client. Client prepares data to burn and transfers it to the server. Server burns the data on CD/DVD. My question is: what is the best protocol to transfer data over the network (Keeping the same directory hierarchy) between different operating systems?

    Read the article

  • Using Remote Web Server to Initialize iPhone App

    - by Chris_K
    My iPhone app relies on a vendor's XML feed to provide data. But that feed is not locked down. The vendor could change the format of the XML at any time, although so far they've promised not to. Since I might want to tell my app to use a different URL for its data source, I'd like to set up a single "Command Central" Web page, on my own server, to direct the app to the correct data source. In other words, each time my app starts, in the background and unseen by the user, it would visit "http://www.myserver.com/iphoneapp_data_sources.xml" to retrieve the URL for retrieving data from my vendor. That way, if my vendor suddenly changes the exact URL or the XML feed that the app needs, I can update that Web page and ensure that all installations of the app are using the correct XML feed. Does anyone have any advice or examples showing this kind of approach? It seems as if this must be a common problem, but so far I haven't found a well-established design pattern that fits it.

    Read the article

  • Stuck with the math in a Flash project, would parsing engine help?

    - by VideoDnd
    I've been stuck with the math in a Flash project? It's a loose design pattern my director formulated. My goal is to keep the project object oriented, and get 'non Flash obstacles' off my plate. Do you recommend using parsing engines for processing math? XML values going to AS3, updating a changing acceleration formula. I don't hate math, but it just doesn't seem OOP or good project planning to have the math stuck in Flash. Your comments are welcome.

    Read the article

  • How big teams work with database

    - by Michael Riva
    Lets say I have a team, 20 developers. And we are making a project on .net. In team every one can easy create their tables according to their modules working on it. And we think to use an ORM, can you tell me how can and which ORM tools for good to working with team. Is there any proven way? I m asking becouse I never work with a team, so I dont know the best practices. So you guys what kind of pattern you use?. I realy wonder. The team members can write their unit tests and supply necessary design patterns. What kind of approach I need to create to manage team? What kind of ORM tools that we have to use?

    Read the article

  • Full stack framework for Java

    - by Jonathan Barbero
    Hello everyone, I'm looking for a full stack framework (from persistency to view generation (CRUD)) for Java. I don't have experience with Rails style frameworks, like Grails, but I worked a lot with Hibernate, Struts, Spring ... I prefer a framework that let you naturally modify the business domain design with the less effort ( i.e. writing the sql querys to modify the tables and constrains, change the view pages, etc ... ). I was looking a bit about this topic, I saw Naked Objects for example but its development has stopped. So, I want to hear about your experience. Thanks in advance.

    Read the article

  • Stored Procedure or calculations via IQueryable?

    - by Shawn Mclean
    This is a question that is based on choosing performance over design practices. If I have a method that will be executed many times a second; public static IQueryable<IPerson> InRadius(this IQueryable<IPerson> query, Coordinate center, double radius) { return (from u in query where CallHeavyMathFormula(u, center, radius) select u); } This extension method for IQueryable generates a SQL that does some heavy maths calculation (Cosine, Sine, etc). This would mean the application sends 1-2KB of sql to the server per call. I've heard of placing all application logic, in your application. I also would like to change to a database such as azure or one of those scalable databases in the future. How do I handle something like this? Should I leave it as it is now or write stored procedures? How do applications like twitter or facebook do it?

    Read the article

  • Windows Phone: Updating backend datastore (via web service) while keeping UI very responsive

    - by will
    I am developing a Windows Phone app where users can update a list. Each update, delete, add etc need to be stored in a database that sits behind a web service. As well as ensuring all the operations made on the phone end up in the cloud, I need to make sure the app is really responsive and the user doesn’t feel any lag time whatsoever. What’s the best design to use here? Each check box change, each text box edit fires a new thread to contact the web service? Locally store a list of things that need to be updated then send to the server in batch every so often (what about the back button)? Am I missing another even easier implementation? Thanks in advance,

    Read the article

  • Books on data-intensive enterprise integration patterns

    - by Tristan
    I'm trying to understand design patterns used by data-intensive enterprise applications. A classic example is the financial industry, where system must consume, analyze, and execute on real-time financial data while providing information and configuration options to a broad set of traders and analysts. One can imagine similar system in airlines, major supply chain operations, and utility providers. Are there good books that provide and inside view of how these systems work? Enterprise Integration Patterns is one example, but I'm looking for something with more real-world applications, particularly in finance.

    Read the article

  • Lazy loading? Better avoiding it?

    - by Charlie Pigarelli
    I just read about this design pattern: Lazy Load. And, since in the application i'm working on i have all the classes in one folder, i was wondering if this pattern could just make me avoiding the include() function for every class. I mean: It's nice to know that if i forgot to include a class, PHP, before falling into an error, trough an __autoload() function try to get it. But is it fine enough to just don't care about including classes and let PHP do it by your own every time? Or we should write __autoload() just in case it is needed?

    Read the article

  • Securing input of private / protected methods?

    - by ts
    Hello, normally, all sane developers are trying to secure input of all public methods (casting to proper types, validating, sanitizing etc.) My question is: are you in your code validating also parameters passed to protected / private methods? In my opinion it is not necessary, if you securize properly parameters of public methods and return values from outside (other classes, db, user input etc...). But I am constantly facing frameworks and apps (ie. prestashop to name one) where validation is often repeated in method call, in method body and once again for securize returned value - which, I think, is creating performace overhead and is also a sign of bad design.

    Read the article

  • Using Remote Web Page to Initialize iPhone App

    - by Chris_K
    My iPhone app relies on a vendor's XML feed to provide data. But that feed is not locked down. The vendor could change the format of the XML at any time, although so far they've promised not to. Since I might want to tell my app to use a different URL for its data source, I'd like to set up a single "Command Central" Web page, on my own server, to direct the app to the correct data source. In other words, each time my app starts, in the background and unseen by the user, it would visit "http://www.myserver.com/iphoneapp_data_sources.xml" to retrieve the URL for retrieving data from my vendor. That way, if my vendor suddenly changes the exact URL or the XML feed that the app needs, I can update that Web page and ensure that all installations of the app are using the correct XML feed. Does anyone have any advice or examples showing this kind of approach? It seems as if this must be a common problem, but so far I haven't found a well-established design pattern that fits it.

    Read the article

  • Session State Anti-Pattern

    - by Curiosity
    I know the SOLID principles and other design patterns fairly well and have been programming for some time now - seeing many a bit of code throughout the years. Having said that, I'm having trouble coming up with a name to give the pattern, or lack thereof, to bits of code I've been dealing with at a current engagement. The application is an ASP.NET C# WebForms application, backed by a SQL Server/Mainframe backend (more mainframe than backend) and it's riddled with Session State properties being accessed/mutated from multiple pages/classes. Accessing/mutating global variables/application state was usually shunned upon while I was in school. Apparently the creators of this magnificent application didn't think it was such a bad idea. Question: Is there a name for such a pattern/anti-pattern that relies so heavily on Session State? I'd like to call the pig by its name ...

    Read the article

  • Should I dive into ASP.NET MVC or start with ASP.NET Webforms?

    - by Sahat
    I plan to pick up Silverlight in the future. Possibility of going into Microsoft WPF. Currently learning Objective-C 2.0 w/ Cocoa. I already know Pros and Cons of ASP.NET MVC vs ASP.NET Webforms. What I want to know is what would be more "efficient" for me to learn given the circumstances above? By efficient I mean learning one design pattern once and then re-using it. Objective-C I believe uses MVC approach? What about Silverlight? WPF? So what do you think? Also as a side question is it true that ASP.NET Webforms is often used by freelancers/small companies and ASP.NET MVC in large enterprises?

    Read the article

< Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >