Search Results

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

Page 139/531 | < Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >

  • What makes Java so suitable for writing NoSQL Databases

    - by good_computer
    Looking at this page that aggregates the current NoSQL landscape, one can see that the majority of these projects are written in Java. Databases are complex systems software dealing with the file system, and so C/C++ would be a better choice than Java for this. (that's my thinking which might be flawed) Secondly, databases deal with transferring large amounts of data from disk to RAM -- which they call a working set. The JVM takes non-trivial amount of RAM for it's own purpose -- so it would be more efficient to use a platform that leaves lots of memory for data instead of hogging it for its own operations. The major relational databases are ALL written in C/C++ MySQL C, C++ Oracle Assembler, C, C++ SQL Server C++ PostgreSQL C SQLite C So what makes Java so popular in NoSQL world.

    Read the article

  • Best Way to Handle Meta Information in a SQL Database

    - by danielhanly.com
    I've got a database where I want to store user information and user_meta information. The reason behind setting it up in this way was because the user_meta side may change over time and I would like to do this without disrupting the master user table. If possible, I would like some advice on how to best set up this meta data table. I can either set it as below: +----+---------+----------+--------------------+ | id | user_id | key | value | +----+---------+----------+--------------------+ | 1 | 1 | email | [email protected] | | 2 | 1 | name | user name | | 3 | 1 | address | test address | ... Or, I can set it as below: +----+---------+--------------------+--------------------+--------------+ | id | user_id | email | name | address | +----+---------+--------------------+--------------------+--------------+ | 1 | 1 | [email protected] | user name | test address | Obviously, the top verison is more flexible, but the bottom version is space saving and perhaps more efficient, returning all the data as a single record. Which is the best way to go about this? Or, am I going about this completely wrong and there's another way I've not thought of?

    Read the article

  • PHP class data implementation

    - by Bakanyaka
    I'm studying OOP PHP and have watched two tutorials that implement user login\registration system as an example. But implementation varies. Which way will be more correct one to work with data such as this? Load all data retrieved from database as array into a property called something like _data on class creation and further methods operate with this property Create separate properties for each field retrieved from database, on class creation load all data fields into respective properties and operate with that properties separately? Then let's say I want to create a method that returns a list of all users with their data. Which way is better? Method that returns just an array of userdata like this: Array([0]=>array([id] => 1, [username] => 'John', ...), [1]=>array([id] => 2, [username] => 'Jack', ...), ...) Method that creates a new instance of it's class for each user and returns an array of objects

    Read the article

  • Is this a valid implementation of the repository pattern?

    - by user1578653
    I've been reading up about the repository pattern, with a view to implementing it in my own application. Almost all examples I've found on the internet use some kind of existing framework rather than showing how to implement it 'from scratch'. Here's my first thoughts of how I might implement it - I was wondering if anyone could advise me on whether this is correct? I have two tables, named CONTAINERS and BITS. Each CONTAINER can contain any number of BITs. I represent them as two classes: class Container{ private $bits; private $id; //...and a property for each column in the table... public function __construct(){ $this->bits = array(); } public function addBit($bit){ $this->bits[] = $bit; } //...getters and setters... } class Bit{ //some properties, methods etc... } Each class will have a property for each column in its respective table. I then have a couple of 'repositories' which handle things to do with saving/retrieving these objects from the database: //repository to control saving/retrieving Containers from the database class ContainerRepository{ //inject the bit repository for use later public function __construct($bitRepo){ $this->bitRepo = $bitRepo; } public function getById($id){ //talk directly to Oracle here to all column data into the object //get all the bits in the container $bits = $this->bitRepo->getByContainerId($id); foreach($bits as $bit){ $container->addBit($bit); } //return an instance of Container } public function persist($container){ //talk directly to Oracle here to save it to the database //if its ID is NULL, create a new container in database, otherwise update the existing one //use BitRepository to save each of the Bits inside the Container $bitRepo = $this->bitRepo; foreach($container->bits as $bit){ $bitRepo->persist($bit); } } } //repository to control saving/retrieving Bits from the database class BitRepository{ public function getById($id){} public function getByContainerId($containerId){} public function persist($bit){} } Therefore, the code I would use to get an instance of Container from the database would be: $bitRepo = new BitRepository(); $containerRepo = new ContainerRepository($bitRepo); $container = $containerRepo->getById($id); Or to create a new one and save to the database: $bitRepo = new BitRepository(); $containerRepo = new ContainerRepository($bitRepo); $container = new Container(); $container->setSomeProperty(1); $bit = new Bit(); $container->addBit($bit); $containerRepo->persist($container); Can someone advise me as to whether I have implemented this pattern correctly? Thanks!

    Read the article

  • Significant amount of the time, I can't think of a reason to have an object instead of a static class. Do objects have more benefits than I think?

    - by Prog
    I understand the concept of an object, and as a Java programmer I feel the OO paradigm comes rather naturally to me in practice. However recently I found myself thinking: Wait a second, what are actually the practical benefits of using an object over using a static class (with proper encapsulation and OO practices)? I could think of two benefits of using an object (both significant and powerful): Polymorphism: allows you to swap functionality dynamically and flexibly during runtime. Also allows to add new functionality 'parts' and alternatives to the system easily. For example if there's a Car class designed to work with Engine objects, and you want to add a new Engine to the system that the Car can use, you can create a new Engine subclass and simply pass an object of this class into the Car object, without having to change anything about Car. And you can decide to do so during runtime. Being able to 'pass functionality around': you can pass an object around the system dynamically. But are there any more advantages to objects over static classes? Often when I add new 'parts' to a system, I do so by creating a new class and instantiating objects from it. But recently when I stopped and thought about it, I realized that a static class would do just the same as an object, in a lot of the places where I normally use an object. For example, I'm working on adding a save/load-file mechanism to my app. With an object, the calling line of code will look like this: Thing thing = fileLoader.load(file); With a static class, it would look like this: Thing thing = FileLoader.load(file); What's the difference? Fairly often I just can't think of a reason to instantiate an object when a plain-old static-class would act just the same. But in OO systems, static classes are fairly rare. So I must be missing something. Are there any more advantages to objects other from the two that I listed? Please explain.

    Read the article

  • Any tips/tricks/resources on actually TEACHING a class on OOP? [closed]

    - by Sempus
    I may slowly be getting into teaching an Object-Orientated Programming class at my school in a year or two. I just graduated and work at my school as an Application Programmer. I'd first start off as a TA/grader and then slowly move into the Professor role. The class would be in Java. I always see resources on this fine site about HOW to program, but does anyone know any tips/tricks/resources on how to TEACH a programming class? It would be full of all different skills levels(but still semi-technical) so it would have to be a little more understandable than if it was just CS kids.

    Read the article

  • Requiring a specific order of compilaiton

    - by Aber Kled
    When designing a compiled programming language, is it a bad idea to require a specific order of compilation of separate units, according to their dependencies? To illustrate what I mean, consider C. C is the opposite of what I'm suggesting. There are multiple .c files, that can all depend on each other, but all of these separate units can be compiled on their own, in no particular order - only to be linked together into a final executable later. This is mostly due to header files. They enable separate units to share information with each other, and thus the units are able to be compiled independently. If a language were to dispose of header files, and only keep source and object files, then the only option would be to actually include the unit's meta-information in the unit's object file. However, this would mean that if the unit A depends on the unit B, then the unit B would need to be compiled before unit A, so unit A could "import" the unit B's object file, thus obtaining the information required for its compilation. Am I missing something here? Is this really the only way to go about removing header files in compiled languages?

    Read the article

  • Separating Db from business with Inherited classes using multiple views

    - by catalinux
    I have a software that has a car model that will be used in different views (listing, ads, detail page, carousel, up sell widget,etc). class CarModel extends DbModel{ } I look for a "nice way" (a combination of flexible, easy to maintain,etc) to have this used in views. I'm thinking at two different ways Having object views for each context CarViewBase{ var car;// of type CarModel function constructor(args){ //will instantienta internal variable car based on args } function getThumb(){ } function getTitle(){ } } CarListingView extends CarViewBase{ function getListing(){ } } CarAdsView extends CarViewBase{ //the busines rule changes for ads widget function getThumb(){ } } Extending directly the CarModel The challenges comes when My Car Model might need an abstract factory. Let's say I have a field on my car object that states the type of the car : a truck, or a bike, or van. How would affect that my object view? Let's say that getTitle() rule would be different for each type of it. How would you do it?

    Read the article

  • Versioning Java APIs in a non-web context

    - by GAP
    I have modular java application which consists of 40 modules. Some of these modules needs to expose external APIs which other modules or any external integration should be using. The system runs as a desktop application and each module is bundled as a separate jar file. My plan is to bundle the external api as a separate jar. But now the question is: how can I maintain multiple versions of the same API to keep backward compatibility in cases where it can co-exist? Are there any de facto standards on handling APIs versioning out of a web context ?

    Read the article

  • "Do it right, against customer's wishes" - how is it called?

    - by SF.
    We know the optimal situation of negotiating corrections of specifications with the customer, getting the specs to do what the client wanted, not what they said or thought they wanted. That's negotiating, explaining. Sometimes, we're unable to convince the client. We're forced to produce broken as designed. This, called "demonology" by merit of mages summoning demons and demons fulfilling their wishes very literally, causing the mage's demise as result, is another approach that will leave the customer very dissatisfied once they realize their error, and of course try to pin the blame on the developer. Now I just faced a very different approach: the customer created simple specs that fail to account for some critical caveat, and is completely unwilling to fix them, admit the obvious errors and accept suggested corrections. The product made to these specs will be critically broken, and possibly might cost human lives. Still, it's too late to drop the contract entirely. The contract has punitive clauses for that, ones we can't really accept. The boss' decision? We do the work right and lie to the customer that we did it according to the specs. The algorithms in question are hidden deep enough under the surface, the product will do the work just fine, won't fail in the caveat situation, and unless someone digs too deep, they will never discover we didn't break it as requested. Is there some common name for this tactics of execution of specs?

    Read the article

  • Do I need to add an index on a table with one row?

    - by briddums
    I'm creating a parameter table in our database. This table will have 1 row with values that are environment specific (production, development, etc). Is there any reason why I should define an index on this table? Update This table is a parameter table which will be used to drive our job queue system. The table will be defined like this: QueuePrm LogLvl integer ShowMs boolean Restart boolean This table will only ever have 1 row. No other table in our system will reference it.

    Read the article

  • How is this paradigm/style called?

    - by McMannus
    I have the following situation: I'm developing an add-in for a UML modeling tool. The models that can be created by the user are stored inside the main application and a limited access to the models is given through its API. However, the add-in has a lot of callbacks for events that are triggered by the main application, when changes to the model occur by the user. Since the models are already stored once in the main application, I considered it not practicable to duplicate the models in the add-in, which leads to the fact that I have only behavior in the add-in, rather than having a state. This behavior is mainly expressed by static functions, that are organized in functional cohesive classes. The callbacks for the events have always references to the model elements relevant for the specifc event that ocurred. First, it seemed to me that this is a procedural style in general, but procedural style doesn't consider events/callbacks, so this boils down to the question. How is this programming style called?

    Read the article

  • How to create a manager class without global variables nor singletons?

    - by Omega
    I would like to implement some kind of manager class in my application. It will be in charge of loading textures, processing them, distributing them etc... At first, I wanted to make a global variable that simply contains an instance of my manager class. I found this question: http://stackoverflow.com/questions/4646577/global-variables-in-java. However, the users there seem to recommend to never use global variables. Fine then, I once heard about Singletons, so I though I could use that instead. I mean, creating just one instance of my manager class sounds good. However, I found this other question: When is Singleton appropriate?, which basically tells me that Singletons are, in most scenarios, some kind of anti-pattern. Now I am a bit lost - what other approach can I take to create my manager class, whose only requirement is to be accessible from anywhere?

    Read the article

  • Architecture driven by users, or by actions/content?

    - by hugerth
    I have a question about designing MVC app architecture. Let's say our application has three main categories of views (items of type 1, items of type 2...). And we have three (or more in future) types of users - Admins, let's say Moderators and typical Users. And in the future there might be more of them. Admins have full access to app, Moderators can visit only 2/3 type of items, and Users can visit only basic type of items. Should I divide my controllers/views/whatever like this: Items "A", Items "B", Items "C", then make them 100% finished and at the end add access privileges? Pros: DRY option Cons Conditional expressions in views Or another options: Items "A" / Admin, Items "A" / Moderator / Items "B" Admin ...? Pros: Divided parts of application for specific user (is that pros?) Cons: A lot of repeated code I don't have great experience in planning such things so it would nice if you can give me some tips or links to learn something about it.

    Read the article

  • how to stop enemies from moving to one point when lots of them are chasing one object [duplicate]

    - by BBgun
    This question already has an answer here: Is there a simple way to stop enemies standing in the same spot? 8 answers i am making a top down game which lots of enemies are chasing one guy. then,enemies would move to one point without any collision,they just overlay each other. so ,is there any simple way to make them feel more real? make them not overlay with each other? ================================= i have tried the solution using boundbox to check collision, but i still very puzzled about what to do with the collision. i have a bad solution.it doesn't work well. my solution in simple: foreach(around_enemy_arr in other) { vector a = normalize(self.positionvector - other.positionvector); self.move_vector = self.move_vector + a; } this can work,but when plenty of enemies come very close to each other,they would shake. i am sooooo confused. please help.

    Read the article

  • Characteristics, what's the inverse of (x*(x+1))/2? [closed]

    - by Valmond
    In my game you can spend points to upgrade characteristics. Each characteristic has a formula like: A) out = in : for one point spent, one pont gained (you spend 1 point on Force so your force goes from 5 to 6) B) out = last level (starting at 1) : so the first point spent earns you 1 point, the next point spent earns you an additional 2 and so on (+3,+4,+5...) C) The inverse of B) : You need to spend 1 point to earn one, then you need to spend 2 to earn another one and so on. I have already found the formula for calculating the actual level of B when points spent = x : charac = (x*(x+1))/2 But I'd like to know what the "reverse" version of B) (usable for C) is, ie. if I have spent x points, how many have I earned if 1 spent gives 1, 1+2=3 gives 2, 1+2+3=6 gives 3 and so on. I know I can just calculate the numbers but I'd like to have the formula because its neater and so that I can stick it in an excel sheet for example... Thanks! ps. I think I have nailed it down to something like charac = sqrt( x*m +k) but then I'm stuck doing number guessing for k and m and I feel I might be wrong anyway as I get close but never hits the spot.

    Read the article

  • VMware vSphere cluster design for site redundancy

    - by Stefan Radovanovici
    I have a question about the best design for site redudancy when using vSphere clusters. A bit of background info about our situation first though. We are a medium-sized company with two main offices, located in different countries. Our networks are linked by a Layer2 150Mbps leased line which is currently underused. We have a variety of services running for internal use within the company, some on physycal servers and some on existing vSphere clusters. In our department we also run several services (almost all running under various forms of Linux) like NTP, Syslog, jump servers, monitoring servers and so on. We have now the requirement that those servers need to be redundant within each location (which they are not at the moment) and also site redudant (which they are to some extent, the servers are duplicated in the 2nd location with configurations kept in sync via various methods at the application layer). There is no SAN available for us, at least not something that we can use at the moment. Cost is also an issue. While we do have some budget available for this, we can't afford to buy SANs for both locations for example. I looked at the VSA feature and it seems that this could be something for us but I am unsure how to solve the site-redudancy requirement. At the moment for testing purposes I am setting up in a lab a vSphere 5 with VSA on two ESXi hosts. I am currently using the Essentials Plus kit with VSA license, which allows me to build a VSA cluster on up to 3 hosts, together with a vCenter license to manage them. The hosts each have two dual-port network cards and two 600GB drives, running in Raid1. Hardware-wise this will be enough for us to run the all the services we need as VMs and will provide redundandcy within the site. At the moment I see only two option to have site redundancy: build an identical VSA cluter in the second location and keep the various services sync'ed at application layer (database sync, rsync and so on). simply move one of the hosts from the existing cluster to the second location, basically having the VSA cluster span the 150Mbps link between the sites. I would very much prefer the second option but I am unsure how well it'll work, if it can work at all. Technically it should, we can span the needed VLANs across the leased line and have them available in the second location. The advantage would be that we don't need to worry at all about sync'ing databases and the like. But I have the feeling that the bandwidth will not be enough, I have no way of knowing how much traffic will the VSA cluster generate between the hosts. I realize that this will most likely depend on the individual usage of the VMs but still, I have no idea how VSA replicates data between the ESXi hosts. Are these my only options or can my goals be achieved in some other way ? Is there perhaps a way to have some sort of "cold stand by" cluster in the second location where the VMs would be sync'ed once per night from the main location ? The idea is that in case the first site becomes unavailable, we would be able to bring all those VMs online there. We would be ok with the data being 1 day old. Any answers are appreciated. Best regards, Stefan

    Read the article

  • Database design - alternatives for Entity Attribute Value (EAV)

    - by Bob
    Hi, see http://stackoverflow.com/questions/695752/product-table-many-kinds-of-product-each-product-has-many-parameters for similar topic. My question: i want to design a database, that will be used for a production facility of different types of products where each product has its own (number of) parameters. because i want the serial numbers to be in one tabel for overview purposes i have a problem with these different paraeters . One solution could be EAV, but it has its downsides, certainly because we have +- 5 products with every product +- 20.000 serial numbers (records). it looks a bit overkill to me... I just don't know how one could design a database so that you have an attribute in a mastertable that says: 'hey, you could find details of this record in THAT detail-table". 'in a way that you qould easely query the results) currenty i am using Visual Basic & Acces 2007. but i'm going to Visual Basic & MySQL. thanks for your help. Bob

    Read the article

  • WPF - Have a list source defined at runtime but still have sample data for design time

    - by Vaccano
    I have some ListBoxes in my WPF app. I would like to be able to view how the design looks with out having to run the app. But I still want to be able to bind to ItemsSource to my View Model. I know I saw a blog post on how to do this, but I cannot seem to find it now. To reiterate, I want dummy data at design time, but real data at run time and not break the MVVM pattern. Any ideas?

    Read the article

  • subsonic in visual studio design host

    - by csizo
    Hi, I'm facing currently a problem regarding Subsonic configuration. What I want to achieve is using subsonic data access in a System.Web.UI.Design.ControlDesigner class. This class is hosted in Visual Studio Environment and enables design time operations on the attached System.Web.UI.WebControls.Control. The only problem is SubSonic seems always looking for SubSonicSection in the application configuration regardless passing connection string to it. The relevant code snippet: using (SharedDbConnectionScope dbScope = new SharedDbConnectionScope(new SqlDataProvider(), ConnectionString)) { Table1 _table1 = new Select().From<..().Where(...).IsEqualTo(...).ExecuteSingle<...>(); Throws exception on ExecuteSingle() method (configuration section was not found) while using (SharedDbConnectionScope dbScope = new SharedDbConnectionScope(ConnectionString)) { Throws exception on new SharedDbConnectionScope() (configuration section was not found) So the question is: Is there any way to pass the settings runtime to bypass the configuration section lookup as I don't want to add any subsonic specific configuration to devenv.configuration Thanks

    Read the article

  • EF and design pattern

    - by kathy
    Hello, I’m working on a high volume transactional enterprise application(asp.net, windows app, oracle app as client) which has been designed using n-tire application and SOA architecture .The application was developed in the .NET platform utilizing C#,VB.NET, Framework 3.5 (I’m planning to upgrade to the , Framework 4.0), EF( EF in the data layer level) and WCF(WCF services in the service layer level) Since this is the first project using EF, and having read about using EF in n-tier and SOA applications, and the features available in the EF Feature, I have the following points: Which design pattern should I use in EF( Simple Entities, Change Set, Self-Tracking Entities and DTOs) in the data layer level In addition Which design pattern should I use in the other tier and layer to get the best practices of EF Thanks

    Read the article

  • wpf: design time error while writing Nested type in xaml

    - by viky
    I have created a usercontrol which accept type of enum and assign the values of that enum to a ComboBox control in that usercontrol. Very Simple. I am using this user control in DataTemplates. Problem comes when there comes nested type. I assign that using this notation EnumType="{x:Type myNamespace:ParentType + NestedType}" It works fine at runtime. but at design time it throws error saying Could not create an instance of type 'TypeExtension' Why? Due to this I am not able to see my window at design time. Any help?

    Read the article

< Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >