Search Results

Search found 55521 results on 2221 pages for 'class design'.

Page 14/2221 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

    - by Laurent Bugnion
    One of my favorite features in Expression Blend is the ability to attach a Visual Studio debugger to Blend. First let’s start by answering the question: why exactly do you want to do that? Note: If you are familiar with the creation and usage of design time data, feel free to scroll down to the paragraph titled “When design time data fails”. Creating design time data for your app When a designer works on an app, he needs to see something to design. For “static” UI such as buttons, backgrounds, etc, the user interface elements are going to show up in Blend just fine. If however the data is fetched dynamically from a service (web, database, etc) or created dynamically, most probably Blend is going to show just an empty element. The classical way to design at that stage is to run the application, navigate to the screen that is under construction (which can involve delays, need to log in, etc…), to measure what is on the screen (colors, margins, width and height, etc) using various tools, going back to Blend, editing the properties of the elements, running again, etc. Obviously this is not ideal. The solution is to create design time data. For more information about the creation of design time data by mocking services, you can refer to two talks of mine “Deep dive MVVM” and “MVVM Applied From Silverlight to Windows Phone to Windows 8”. The source code for these talks is here and here. Design time data in MVVM Light One of the main reasons why I developed MVVM Light is to facilitate the creation of design time data. To illustrate this, let’s create a new MVVM Light application in Visual Studio. Install MVVM Light from here: http://mvvmlight.codeplex.com (use the MSI in the Download section). After installing, make sure to read the Readme that opens up in your favorite browser, you will need one more step to install the Project Templates. Start Visual Studio 2012. Create a new MvvmLight (Win8) app. Run the application. You will see a string showing “Welcome to MVVM Light”. In the Solution explorer, right click on MainPage.xaml and select Open in Blend. Now you should see “Welcome to MVVM Light [Design]” What happens here is that Expression Blend runs different code at design time than the application runs at runtime. To do this, we use design-time detection (as explained in a previous article) and use that information to initialize a different data service at design time. To understand this better, open the ViewModelLocator.cs file in the ViewModel folder and see how the DesignDataService is used at design time, while the DataService is used at runtime. In a real-life applicationm, DataService would be used to connect to a web service, for instance. When design time data fails Sometimes however, the creation of design time data fails. It can be very difficult to understand exactly what is happening. Expression Blend is not giving a lot of information about what happened. Thankfully, we can use a trick: Attaching a debugger to Expression Blend and debug the design time code. In WPF and Silverlight (including Windows Phone 7), you could simply attach the debugger to Blend.exe (using the “Managed (v4.5, v4.0) code” option even for Silverlight!!) In Windows 8 however, things are just a bit different. This is because the designer that renders the actual representation of the Windows 8 app runs in its own process. Let’s illustrate that: Open the file DesignDataService in the Design folder. Modify the GetData method to look like this: public void GetData(Action<DataItem, Exception> callback) { throw new Exception(); // Use this to create design time data var item = new DataItem("Welcome to MVVM Light [design]"); callback(item, null); } Go to Blend and build the application. The build succeeds, but now the page is empty. The creation of the design time data failed, but we don’t get a warning message. We need to investigate what’s wrong. Close MainPage.xaml Go to Visual Studio and select the menu Debug, Attach to Process. Update: Make sure that you select “Managed (v4.5, v4.0) code” in the “Attach to” field. Find the process named XDesProc.exe. You should have at least two, one for the Visual Studio 2012 designer surface, and one for Expression Blend. Unfortunately in this screen it is not obvious which is which. Let’s find out in the Task Manager. Press Ctrl-Alt-Del and select Task Manager Go to the Details tab and sort the processes by name. Find the one that says “Blend for Microsoft Visual Studio 2012 XAML UI Designer” and write down the process ID. Go back to the Attach to Process dialog in Visual Studio. sort the processes by ID and attach the debugger to the correct instance of XDesProc.exe. Open the MainViewModel (in the ViewModel folder) Place a breakpoint on the first line of the MainViewModel constructor. Go to Blend and open the MainPage.xaml again. At this point, the debugger breaks in Visual Studio and you can execute your code step by step. Simply step inside the dataservice call, and find the exception that you had placed there. Visual Studio gives you additional information which helps you to solve the issue. More info and Conclusion I want to thank the amazing people on the Expression Blend team for being very fast in guiding me in that matter and encouraging me to blog about it. More information about the XDesProc.exe process can be found here. I had to work on a Windows 8 app for a few days without design time data because of an Exception thrown somewhere in the code, and it was really painful. With the debugger, finding the issue was a simple matter of stepping into the code until it threw the exception.   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • How do you approach database design?

    - by bron
    I am primarily a web developer and I have a couple of personal projects which I want to kick off. One thing that is bugging me is database design. I have gone through in school db normalization and stuff like that but it has been a couple of years ago and I have never had experience with relational database design except for school. So how you do you approach database from a web app perspective? How do you begin and what do you look out for? What are flags for caution?

    Read the article

  • How to design software when using BDD?

    - by Léster
    I'm working on a project right now and it's my first project using BDD. Up till now, the user stories have proven themselves a very valuable weapon to understand requirements and to specify the solution in a comprehensive, easy to understand language. My question is this: now that my user stories are complete, how do I design my solution? I understand that I derive behavior tests from my user stories, and I have to do UI design, but am I supposed to use good ol' UML? I'm under the impression that when using user stories, UML is left out; is this correct? Léster

    Read the article

  • Recommended reading for (Object Oriented) application design architecture?

    - by e4rthdog
    In life it doesnt matter if you do one thing for 15 years. You will end up waking one day and asking stuff that are equal to "how do i walk?" :) My specific question is that as a new entrant to C# and OOP i am stepping into many little "details" that need to be addressed. Written a lot of code in VB.NET / cobol / simple php e.t.c surely does not help much into the OOP world... So , even after reading entry level books for C# and watching some videos i recently found out about the "factory model design" for applications. I would appreciate if any of you guys recomment some reading on application design architecture for further reading...

    Read the article

  • How to fill certain application design learning "gaps"?

    - by e4rthdog
    In life it doesnt matter if you do one thing for 15 years. You will end up waking one day and asking stuff that are equal to "how do i walk?" :) My specific question is that as a new entrant to C# and OOP i am stepping into many little "details" that need to be addressed. Written a lot of code in VB.NET / cobol / simple php e.t.c surely does not help much into the OOP world... So , even after reading entry level books for C# and watching some videos i recently found out about the "factory model design" for applications. I would appreciate if any of you guys recomment some reading on application design architecture for further reading...

    Read the article

  • Online examples for software design diagrams

    - by Gerenuk
    Do you know where I can find a good example of software design diagrams and specs on the internet? Like UML, specs and similar. I'd like to understand this approach better. Before I just started coding and now I'd like plan more in advance. By diagrams I don't mean made-up examples, but something that would actually be used. Also it shouldn't be so trivial that there is no use of using diagrams. Ideally it shouldn't be too large either. Do you know a good online source? (this question is about online resources and specific examples only. it is not asking about books or advise how to learn software design.)

    Read the article

  • Design Patterns - do you use them?

    - by seth
    Being an IT student, I was recently given some overview about design patterns by one of our teachers. I understood what they are for but some aspects still keep bugging me. Are they really used by the majority of programmers? Speaking of experience, I've had some troubles while programming, things I could not solve for a while, but google and some hours of research solved my problem. If somewhere in the web I find a way to solve my problem, is this a design pattern? Am I using it? And also, do you (programmers) find yourself looking for patterns (where am I supposed to look btw?) when you start the development? If so, this is certainly a habit that I must start to embrace.

    Read the article

  • Design documents as part of Agile

    - by syrion
    At my workplace, we face a challenge in that "agile" too often has meant "vague requirements, bad acceptance criteria, good luck!" We're trying to address that, as a general improvement effort. So, as part of that, I am proposing that we generate design documents that, above and beyond the user story level, accurately reflect the outcome of preliminary investigations of the effect of a given feature within the system and including answers to questions that we have asked the business. Is there an effective standard for this? We currently face a situation where a new feature may impact multiple areas in our "big ball of mud" system, and estimates are starting to climb due to this technical debt. Hopefully more thoughtful design processes can help.

    Read the article

  • Software design methods for Java or any other programming language

    - by IkerB
    I'm junior programmer and I would like to know how professionals write their code or which steps they follow when they are creating new software. I mean, which steps they follow, which programming methodology, software architecture design application software, etc. I would like to find a tutorial where they explain from the beginning which steps I have to follow from The Idea I have in my mind to the final version of the application in any language. Or perhaps how is your programming steps or rules that you used to follow. Because everytime I want to create the an application I spend few time on the design and a lot of time coding (I know, that's not good).

    Read the article

  • All around design book for a developer (Javascript dev)

    - by Alex Angelini
    I have begun doing a lot of javascript development recently, mostly front-end but also using node.js. As I am currently in the transition from large company to startup, they expect me as a front end developer to know how to produce semi decent designs (Which I cannot) I am looking for a book (or set of screencasts) to give me some good well rounded advice on design. I know CSS, but my design are always awful looking, I also know nothing about Photoshop (and am on Linux and have no access to it) What are your picks? I am not looking to be a full time designer I would just like to be able to contribute.

    Read the article

  • initial Class design: access modifiers and no-arg constructors

    - by yas
    Context: Student working through Class design in personal/side project for Summer. I've never written anything implemented by others or had to maintain code. Trying to maximize encapsulation and imagining what would make code easy to maintain. Concept: Tight/Loose Class design where Tight and Loose refer to access modifiers and constructors. Tight: initially, everything, including setters, is private and a no-arg constructor is not provided (only a full constructor). Loose: not Tight Exceptions: the obvious like toString Reasoning: If code, at the very beginning, is tight, then it should be guaranteed that changes, with respect to access/creation, should never damage existing implementations. The loosening of code happens incrementally and must be thought through, justified, and safe (validated). Benefit: Existing implementing code should not break if changes are made later. Cost: Takes more time to create. Since this is my own thinking, I hope to get feedback as to whether I should push to work this way. Good idea or bad idea?

    Read the article

  • Design difficulty for multiple panel forms [closed]

    - by petre
    I have form that consists of multiple panel on the right, a treeview on the left and a terminal richtextbox on the bottom. When i click on a node of the treeview i bring up the panel that is attached with the node. For example i have 10 nodes on the treeview, i have 10 panels that are attached to this nodes. On every panel, i have many textboxes, labels, comboboxes etc. I don't dynamically construct and dispose the items on the panels, i create the items in the designer file of the project. In that case, there is a problem. I really find it difficult to align or place items on the panel because there seems a lot of aligning lines on the screen. What should be done to make the design of the panels easy? I don't want to construct items dynamically. Do i have to do that dynamically or is there a design procedure that make this process easy?

    Read the article

  • does class reference itself static anti pattern in prism

    - by Michael Riva
    I have an application and my desing approach look like this: class Manager { public int State; static Manager _instance = null; public static Manager Instance { get { return _instance; } set { if (_instance == value) return; _instance = value; } } public Manager() { State = 0; Instance=this; } } class Module1 { public void GetState() { Console.WriteLine(Manager.Instance.State); } } class Module2 { public void GetState() { Console.WriteLine(Manager.Instance.State); } } class Module3 { public void GetState() { Console.WriteLine(Manager.Instance.State); } } Manager class already registered in Bootstrapper like : protected override void ConfigureContainer() { base.ConfigureContainer(); Container.RegisterType<Manager>(new ContainerControlledLifetimeManager()); } protected override void InitializeModules() { Manager man= Container.Resolve<Manager>(); } Question is do I need to define my manager object as static in its field to be able to reach its state? Or this is anti pattern or bad for performance?

    Read the article

  • design practice for business layer when supporting API versioning

    - by user1186065
    Is there any design pattern or practice recommended for business layer when dealing with multiple API version. For example, I have something like this. http://site.com/blogs/v1/?count=10 which calls business object method GetAllBlogs(int count) to get information http://site.com/blogs/v2/?blog_count=20 which calls business object method GetAllBlogs_v2(int blogCounts) Since parameter name is changed, I created another business method for version 2. This is just one example but it could have other breaking changes for which it requires me to create another method to support both version. Is there any design pattern or best practice for business/data access layer I should follow when supporting API Versioning?

    Read the article

  • Scenario to illustrate how unit testing leads to better design

    - by Cocowalla
    For an internal training session, I'm trying to come up with a simple scenario that illustrates how unit testing leads to better design, by forcing you to think about things like coupling before you start coding. The idea is that I get the participants to code something first, without considering unit testing, then we do it again, but considering unit testing. Hopefully the code produced second time round should be more decoupled and maintainable. I'm struggling to come up with a scenario that can be coded quickly, yet can still demonstrate how unit testing can lead to better overall design.

    Read the article

  • Code Design question, circular reference across classes?

    - by dsollen
    I have no code here, as this is more of a design question (I assume this is still the best place to ask it). I have a very simple server in java which stores a mapping between certain values and UUID which are to be used by many systems across multiple platforms. It accepts a connection from a client and creates a clientSocket which stores the socket and all the other relevant data unique to that connection. Each clientSocket will run in their own thread and will block on the socket waiting for a read. I expect very little strain on this system, it will rarely get called, but when it does get a call it will need to respond quickly and due to the risk of it having a peak time with multiple calls coming in at once threaded is still better. Each thread has a reference to a Mapper class which stores the mapping of UUID which it's reporting to others (with proper synchronization of course). This all works until I have to add a new UUID to the list. When this happens I want to report to all clients that care about that particular UUID that a new one was added. I can't multicast (limitation of the system I'm running on) so I'm having each socket send the message to the client through the established socket. However, since each thread only knows about the socket it's waiting on I didn't have a clear method of looking up every thread/socket that cares about the data to inform them of the new UUID. Polling is out mostly because it seems a little too convoluted to try to maintain a list of newly added UUID. My solution as of now is to have the 'parent' class which creates the mapper class and spawns all the threads pass itself as an argument to the mapper. Then when the mapper creates a new UUID it can make a call to the parent class telling it to send out updates to all the other sockets that care about the change. I'm concerned that this may be a bad design due to the use of a circular reference; parent has a reference to mapper (to pass it to new ClientSocket threads) and mapper points to parent. It doesn't really feel like a bad design to me but I wanted to check since circular references are suppose to be bad. Note: I realize this means that the thread associated with whatever socket originally received the request that spawned the creation of a UUID is going to pay the 'cost' of outputting to all the other clients that care about the new UUID. I don't care about this; as I said I suspect the client to receive only intermittent messages. It's unlikely for one socket to receive multiple messages at one time, and there won't be that many sockets so it shouldn't take too long to send messages to each of them. Perhaps later I'll fix the fact that I'm saddling higher work load on whatever unfortunate thread gets the first request; but for now I think it's fine.

    Read the article

  • Design Patterns - Service Layer

    - by garfbradaz
    I currently reading a lot about Design Patterns and I have been watching various Pluralsight videos from their library. Now so far I have learnt the following: Repository Pattern Unit of Work Pattern Abstract Factory Pattern Reading the awesome "DI in .NET" book Now I read lot about Services and Service Layers and wanted some advice about the best place to read up and learn about these. I presume this fits into Domain Driven Design and I should start there? The term "Service" just seem to be used widely within IT and it can be confusing the exact meaning. So my questions is: What is the Service Layer Where is the best place to learn about them. I know there are probably tonnes of interweb/books/blogs on the subject, but some good areas to start from would be nice. If I'm being too vague, let me know.

    Read the article

  • The Design of the Namecheap Site [on hold]

    - by Guest
    I was just wondering what design Namecheap.com is using for their site. I asked their support personnel and I suppose the employees aren't generally aware. It really looks like a customized wordpress site, but I was wondering if anyone here knew any more details about their setup. Been googling for it but the problem is, since namecheap DEALS with CMS's/web design for their business, you'll get google hits regarding their business rather than describing their site itself. Just interested. If anyone's got any info on it let me know.

    Read the article

  • What Design Pattern is seperating transform converters

    - by RevMoon
    For converting a Java object model into XML I am using the following design: For different types of objects (e.g. primitive types, collections, null, etc.) I define each its own converter, which acts appropriate with respect to the given type. This way it can easily extended without adding code to a huge if-else-then construct. The converters are chosen by a method which tests whether the object is convertable at all and by using a priority ordering. The priority ordering is important so let's say a List is not converted by the POJO converter, even though it is convertable as such it would be more appropriate to use the collection converter. What design pattern is that? I can only think of a similarity to the command pattern.

    Read the article

  • What Design Pattern is separating transform converters

    - by RevMoon
    For converting a Java object model into XML I am using the following design: For different types of objects (e.g. primitive types, collections, null, etc.) I define each its own converter, which acts appropriate with respect to the given type. This way it can easily extended without adding code to a huge if-else-then construct. The converters are chosen by a method which tests whether the object is convertable at all and by using a priority ordering. The priority ordering is important so let's say a List is not converted by the POJO converter, even though it is convertable as such it would be more appropriate to use the collection converter. What design pattern is that? I can only think of a similarity to the command pattern.

    Read the article

  • Design Pattern for Data Validation

    - by melodui
    What would be the best design pattern for this problem: I have an Object A. Object A can either be registered or deleted from the database depending on the user request. Data validation is performed before registration or deletion of the object. There are a set of rules to be checked before the object can be registered and another set of rules for deletion. Some of these rules are common for both operations. So far, I think the Chain of Responsibility design pattern fits the most but I'm having trouble implementing it.

    Read the article

  • Add class to elements which already have a class

    - by bwstud
    I have a group of divs which I'm dynamically generating when a button is clicked with the class, "brick". This gives them dimension and starting position of top: 0. I'm trying to get them to animate to the bottom of the view using a css transition with a second class assignment which gives them a bottom position: 0;. Can't figure out the syntax for adding a second class to elements with a pre-existing class. On inspection they only show the original class of, "brick". HTML <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <div id="container"> <div id="button" >Click Me</div> </div> </body> </html> CSS #container { width: 100%; height: 100vh; padding: 10vmax; } #button { position: fixed; } .brick { position: relative; top: 0; height: 10vmax; width: 20vmax; background: white; margin: 0; padding: 0; transition: all 1s; } .drop { transition: all 1s; bottom 0; } The offending JS: var brickCount = function() { var count = prompt("How many boxes you lookin' for?"); for(var i=0; i < count; i++) { var newBrick = document.createElement("div"); newBrick.className="brick"; document.querySelector("#container") .appendChild(newBrick); } }; var getBricks = function(){ document.getElementByClass("brick"); }; var changeColor = function(){ getBricks.style.backgroundColor = '#'+Math.floor(Math.random()*16777215).toString(16); }; var addDrop = function() { getBricks.brick = "getBricks.brick" + " drop"; }; var multiple = function() { brickCount(); getBricks(); changeColor(); addDrop(); }; document.getElementById("button").onclick = function() {multiple();}; Thanks!

    Read the article

  • PHP Changing Class Variables Outside of Class

    - by Jamie Bicknell
    Apologies for the wording on this question, I'm having difficulties explaining what I'm after, but hopefully it makes sense. Let's say I have a class, and I wish to pass a variable through one of it's methods, then I have another method which outputs this variable. That's all fine, but what I'm after is that if I update the variable which was originally passed, and do this outside the class methods, it should be reflected in the class. I've created a very basic example: class Test { private $var = ''; function setVar($input) { $this->var = $input; } function getVar() { echo 'Var = ' . $this->var . '<br />'; } } If I run $test = new Test(); $string = 'Howdy'; $test->setVar($string); $test->getVar(); I get Var = Howdy However, this is the flow I would like: $test = new Test(); $test->setVar($string); $string = 'Hello'; $test->getVar(); $string = 'Goodbye'; $test->getVar(); Expected output to be Var = Hello Var = Goodbye I don't know what the correct naming of this would be, and I've tried using references to the original variable but no luck. I've come across this in the past, with the PDO prepared statements, see Example #2 $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (?, ?)"); $stmt->bindParam(1, $name); $stmt->bindParam(2, $value); // insert one row $name = 'one'; $value = 1; $stmt->execute(); // insert another row with different values $name = 'two'; $value = 2; $stmt->execute(); I know I can change the variable to public and do the following, but it isn't quite the same as how the PDO class handles it, and I'm really looking to mimic that behaviour. $test = new Test(); $test->setVar($string); $test->var = 'Hello'; $test->getVar(); $test->var = 'Goodbye'; $test->getVar(); Any help, ideas, pointers, or advice would be greatly appreciated, thanks.

    Read the article

  • Create inherited class from base class

    - by Raj
    public class Car { private string make; private string model; public Car(string make, string model) { this.make = make; this.model = model; } public virtual void Display() { Console.WriteLine("Make: {0}", make); Console.WriteLine("Model: {0}", model); } public string Make { get{return make;} set{make = value;} } public string Model { get{return model;} set{model = value;} } } public class SuperCar:Car { private Car car; private int horsePower; public SuperCar(Car car) { this.car = car; } public int HorsePower { get{return horsePower;} set{horsepower = value;} } public override void Display() { base.Display(); Console.WriteLine("I am a super car"); } When I do something like Car myCar = new Car("Porsche", "911"); SuperCar mySupcar = new SuperCar(myCar); mySupcar.Display(); I only get "I am a supercar" but not the properties of my base class. Should I explicitly assign the properties of my base class in the SuperCar constructor? In fact I'm trying Decorator pattern where I want a class to add behaviour to a base class.

    Read the article

  • private class calling a method from its outer class

    - by oxinabox.ucc.asn.au
    Ok, so I have a class for a "Advanced Data Structure" (in this case a kinda tree) SO I implimented a Iterator as a private class with in it. So the iterator needs to implement a remove function to remove the last retuirned element. now my ADT already impliments a remove function, and in this case there is very little (thinking about it, i think nothing) to be gain by implimenting a different remove function for the iterator. so how do I go about calling the remove from my ADT sketch of my struture: public class ADT { ... private class ADT_Iterator impliments java.util.Itorator{ ... public void remove(){ //where I want to call the ADT's remove function from } ... public void remove( Object paramFoo ) { ... } ... } So just calling remove(FooInstance) won't work (will it?) and this.remove(FooInstance) is the same thing. what do i call? (and changign the name of the ADT's remove function is not an option, as that AD T has to meet an Interace wich I am note at liberty to change) I could make both of them call a removeHelper functon, I guess...

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >