Search Results

Search found 33755 results on 1351 pages for 'object repository'.

Page 1/1351 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Create a Remote Git Repository from an Existing XCode Repository

    - by codeWithoutFear
    Introduction Distributed version control systems (VCS’s), like Git, provide a rich set of features for managing source code.  Many development tools, including XCode, provide built-in support for various VCS’s.  These tools provide simple configuration with limited customization to get you up and running quickly while still providing the safety net of basic version control. I hate losing (and re-doing) work.  I have OCD when it comes to saving and versioning source code.  Save early, save often, and commit to the VCS often.  I also hate merging code.  Smaller and more frequent commits enable me to minimize merge time and effort as well. The work flow I prefer even for personal exploratory projects is: Make small local changes to the codebase to create an incrementally improved (and working) system. Commit these changes to the local repository.  Local repositories are quick to access, function even while offline, and provides the confidence to continue making bold changes to the system.  After all, I can easily recover to a recent working state. Repeat 1 & 2 until the codebase contains “significant” functionality and I have connectivity to the remote repository. Push the accumulated changes to the remote repository.  The smaller the change set, the less likely extensive merging will be required.  Smaller is better, IMHO. The remote repository typically has a greater degree of fault tolerance and active management dedicated to it.  This can be as simple as a network share that is backed up nightly or as complex as dedicated hardware with specialized server-side processing and significant administrative monitoring. XCode’s out-of-the-box Git integration enables steps 1 and 2 above.  Time Machine backups of the local repository add an additional degree of fault tolerance, but do not support collaboration or take advantage of managed infrastructure such as on-premises or cloud-based storage. Creating a Remote Repository These are the steps I use to enable the full workflow identified above.  For simplicity the “remote” repository is created on the local file system.  This location could easily be on a mounted network volume. Create a Test Project My project is called HelloGit and is located at /Users/Don/Dev/HelloGit.  Be sure to commit all outstanding changes.  XCode always leaves a single changed file for me after the project is created and the initial commit is submitted. Clone the Local Repository We want to clone the XCode-created Git repository to the location where the remote repository will reside.  In this case it will be /Users/Don/Dev/RemoteHelloGit. Open the Terminal application. Clone the local repository to the remote repository location: git clone /Users/Don/Dev/HelloGit /Users/Don/Dev/RemoteHelloGit Convert the Remote Repository to a Bare Repository The remote repository only needs to contain the Git database.  It does not need a checked out branch or local files. Go to the remote repository folder: cd /Users/Don/Dev/RemoteHelloGit Indicate the repository is “bare”: git config --bool core.bare true Remove files, leaving the .git folder: rm -R * Remove the “origin” remote: git remote rm origin Configure the Local Repository The local repository should reference the remote repository.  The remote name “origin” is used by convention to indicate the originating repository.  This is set automatically when a repository is cloned.  We will use the “origin” name here to reflect that relationship. Go to the local repository folder: cd /Users/Don/Dev/HelloGit Add the remote: git remote add origin /Users/Don/Dev/RemoteHelloGit Test Connectivity Any changes made to the local Git repository can be pushed to the remote repository subject to the merging rules Git enforces. Create a new local file: date > date.txt /li> Add the new file to the local index: git add date.txt Commit the change to the local repository: git commit -m "New file: date.txt" Push the change to the remote repository: git push origin master Now you can save, commit, and push/pull to your OCD hearts’ content! Code without fear! --Don

    Read the article

  • apt-get install and update fail

    - by sepehr
    I've got a problem with apt-get update and apt-get install ... commands . every time update or installing fails and errors are : Get:1 http://dl.google.com stable Release.gpg [198B] Ign http://dl.google.com/linux/chrome/deb/ stable/main Translation-en_US Get:2 http://dl.google.com stable Release [1,347B] Get:3 http://dl.google.com stable/main Packages [1,227B] Err http://32.repository.backtrack-linux.org revolution Release.gpg Could not connect to 32.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) Err http://32.repository.backtrack-linux.org/ revolution/main Translation-en_US Unable to connect to 32.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org/ revolution/microverse Translation-en_US Unable to connect to 32.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org/ revolution/non-free Translation-en_US Unable to connect to 32.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org/ revolution/testing Translation-en_US Unable to connect to 32.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org revolution Release.gpg Could not connect to all.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) Err http://all.repository.backtrack-linux.org/ revolution/main Translation-en_US Unable to connect to all.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org/ revolution/microverse Translation-en_US Unable to connect to all.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org/ revolution/non-free Translation-en_US Unable to connect to all.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org/ revolution/testing Translation-en_US Unable to connect to all.repository.backtrack-linux.org:http: Ign http://32.repository.backtrack-linux.org revolution Release Ign http://all.repository.backtrack-linux.org revolution Release Ign http://32.repository.backtrack-linux.org revolution/main Packages Ign http://all.repository.backtrack-linux.org revolution/main Packages Ign http://32.repository.backtrack-linux.org revolution/microverse Packages Ign http://32.repository.backtrack-linux.org revolution/non-free Packages Ign http://32.repository.backtrack-linux.org revolution/testing Packages Ign http://all.repository.backtrack-linux.org revolution/microverse Packages Ign http://all.repository.backtrack-linux.org revolution/non-free Packages Ign http://all.repository.backtrack-linux.org revolution/testing Packages Ign http://32.repository.backtrack-linux.org revolution/main Packages Ign http://32.repository.backtrack-linux.org revolution/microverse Packages Ign http://32.repository.backtrack-linux.org revolution/non-free Packages Ign http://all.repository.backtrack-linux.org revolution/main Packages Ign http://all.repository.backtrack-linux.org revolution/microverse Packages Ign http://all.repository.backtrack-linux.org revolution/non-free Packages Ign http://all.repository.backtrack-linux.org revolution/testing Packages Err http://all.repository.backtrack-linux.org revolution/main Packages Unable to connect to all.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org revolution/microverse Packages Unable to connect to all.repository.backtrack-linux.org:http: Ign http://32.repository.backtrack-linux.org revolution/testing Packages Err http://32.repository.backtrack-linux.org revolution/main Packages Unable to connect to 32.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org revolution/microverse Packages Unable to connect to 32.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org revolution/non-free Packages Unable to connect to all.repository.backtrack-linux.org:http: Err http://all.repository.backtrack-linux.org revolution/testing Packages Unable to connect to all.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org revolution/non-free Packages Unable to connect to 32.repository.backtrack-linux.org:http: Err http://32.repository.backtrack-linux.org revolution/testing Packages Unable to connect to 32.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org revolution Release.gpg Could not connect to source.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) Err http://source.repository.backtrack-linux.org/ revolution/main Translation-en_US Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org/ revolution/microverse Translation-en_US Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org/ revolution/non-free Translation-en_US Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org/ revolution/testing Translation-en_US Unable to connect to source.repository.backtrack-linux.org:http: Ign http://source.repository.backtrack-linux.org revolution Release Ign http://source.repository.backtrack-linux.org revolution/main Packages Ign http://source.repository.backtrack-linux.org revolution/microverse Packages Ign http://source.repository.backtrack-linux.org revolution/non-free Packages Ign http://source.repository.backtrack-linux.org revolution/testing Packages Ign http://source.repository.backtrack-linux.org revolution/main Packages Ign http://source.repository.backtrack-linux.org revolution/microverse Packages Ign http://source.repository.backtrack-linux.org revolution/non-free Packages Ign http://source.repository.backtrack-linux.org revolution/testing Packages Err http://source.repository.backtrack-linux.org revolution/main Packages Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org revolution/microverse Packages Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org revolution/non-free Packages Unable to connect to source.repository.backtrack-linux.org:http: Err http://source.repository.backtrack-linux.org revolution/testing Packages Unable to connect to source.repository.backtrack-linux.org:http: Fetched 2,772B in 1min 3s (44B/s) W: Failed to fetch http://all.repository.backtrack- \linux.org/dists/revolution/Release.gpg Could not connect to all.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2 Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2 Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2 Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2 Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/Release.gpg Could not connect to 32.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2 Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2 Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2 Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2 Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/Release.gpg Could not connect to source.repository.backtrack-linux.org:80 (37.221.173.214). - connect (110: Connection timed out) W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2 Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2 Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2 Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2 Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/main/binary-i386/Packages.gz Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/microverse/binary-i386/Packages.gz Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/non-free/binary-i386/Packages.gz Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/main/binary-i386/Packages.gz Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/microverse/binary-i386/Packages.gz Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/non-free/binary-i386/Packages.gz Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/testing/binary-i386/Packages.gz Unable to connect to all.repository.backtrack-linux.org:http: W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/testing/binary-i386/Packages.gz Unable to connect to 32.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/main/binary-i386/Packages.gz Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/microverse/binary-i386/Packages.gz Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/non-free/binary-i386/Packages.gz Unable to connect to source.repository.backtrack-linux.org:http: W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/testing/binary-i386/Packages.gz Unable to connect to source.repository.backtrack-linux.org:http: E: Some index files failed to download, they have been ignored, or old ones used instead. I Don't know how to get out of this ! I want to install RPM and YUM package on my backtrack ! I also searched over internet for answer . in backtrack forums or any other sites or weblogs i could'nt find a good answer ! can anyone help ??

    Read the article

  • Architecture Best Practice (MVC): Repository Returns Object & Object Member Accessed Directly or Repository Returns Object Member

    - by coderabbi
    Architecturally speaking, which is the preferable approach (and why)? $validation_date = $users_repository->getUser($user_id)->validation_date; Seems to violate Law of Demeter by accessing member of object returned by method call Seems to violate Encapsulation by accessing object member directly $validation_date = $users_repository->getUserValidationDate($user_id); Seems to violate Single Responsibility Principle as $users_repository no longer just returns User objects

    Read the article

  • Relationship between Repository and Unit of Work

    - by NullOrEmpty
    I am going to implement a repository, and I would like to use the UOW pattern since the consumer of the repository could do several operations, and I want to commit them at once. After read several articles about the matter, I still don't get how to relate this two elements, depending on the article it is being done in a way u other. Sometimes the UOW is something internal to the repository: public class Repository { UnitOfWork _uow; public Repository() { _uow = IoC.Get<UnitOfWork>(); } public void Save(Entity e) { _uow.Track(e); } public void SubmittChanges() { SaveInStorage(_uow.GetChanges()); } } And sometimes it is external: public class Repository { public void Save(Entity e, UnitOfWork uow) { uow.Track(e); } public void SubmittChanges(UnitOfWork uow) { SaveInStorage(uow.GetChanges()); } } Other times, is the UOW whom references the Repository public class UnitOfWork { Repository _repository; public UnitOfWork(Repository repository) { _repository = repository; } public void Save(Entity e) { this.Track(e); } public void SubmittChanges() { _repository.Save(this.GetChanges()); } } How are these two elements related? UOW tracks the elements that needs be changed, and repository contains the logic to persist those changes, but... who call who? Does the last make more sense? Also, who manages the connection? If several operations have to be done in the repository, I think using the same connection and even transaction is more sound, so maybe put the connection object inside the UOW and this one inside the repository makes sense as well. Cheers

    Read the article

  • When would you want two references to the same object?

    - by HCBPshenanigans
    In Java specifically, but likely in other languages as well; When would it be useful to have two references to the same object? Example: Dog a = new Dog(); Dob b = a; Is there a situation where this would be useful? Why would this be a preferred solution to using a whenever you want to interact with the object represented by a? Edit: Can I just say that all of your dog related examples are Delightful!

    Read the article

  • How to safely copy an object?

    - by Prog
    This question is going to be a little long. Please bear with me. Something that happened in a project of mine made me think about how to safely copy objects. I'll present the situation I had and then ask a question. There was a class SomeClass: class SomeClass{ Thing[] things; public SomeClass(Thing[] things){ this.things = things; } // irrelevant stuff omitted public SomeClass copy(){ return new SomeClass(things); } } There was another class Processor that takes SomeClass objects, copies them (via someClassInstance.copy()), manipulates the copy's state, and returns the copy. Here it is: class Processor{ public SomeClass processObject(SomeClass object){ SomeClass copy = object.copy(); manipulateTheCopy(copy); return copy; } // irrelevant stuff omitted } I ran this, and it had bugs. I looked into these bugs, and it turned out that the manipulations Processor does on copy actually affect not only the copy, but also the original SomeClass object that was passed into processObject. I found out that it was because the original and the copy shared state - because the original passed it's field things into the copy when creating it. This made me realize that copying objects is harder than simply instantiating them with the same fields as the original. For the two objects to be completely disconnected, without any shared state, each of the fields passed to the copy also has to be copied. And if that object contains other objects - they have to be copied too. And so on. So basically, in order to be able to actually copy an object, each class in the system must have a copy() method, that also invokes copy() on all of it's fields, and so on. So for example, for copy() in SomeClass to work, it needs to look like this: public SomeClass copy(){ Thing[] copyThings = new Thing[things.length]; for(int i=0; i<things.length; i++) copyThings[i] = things[i].copy(); return new SomeClass(copyThings); } And if Thing has object fields of it's own, than it's own copy() method must be appropriate: class Thing{ Apple apple; Pencil pencil; int number; public Thing(Apple apple, Pencil pencil, int number){ this.apple = apple; this.pencil = pencil; this.number = number; } public Thing copy(){ // 'number' is a primitve. return new Thing(apple.getCopy(), pencil.getCopy(), number); } } And so on. Of course, instead of all classes having a copy() method, the copying mechanism can happen in all of the getters and the constructors of classes (unless places where it isn't suitable, for example when the field points to an external object, not to an object that 'is part' of this object). Still, that means that in order to be able to safely copy an object - most classes would have to have copying mechanisms in their getters. My question is divided into two parts: How frequently do you need to get a copy of an object? Is this a regular issue? Is the technique described common and/or reasonable? Or is there a better way to make safe copies of objects? Or is there an easier way to safely copy objects, without them sharing any state?

    Read the article

  • Converting mercurial repository to svn repository

    - by Jay
    I know you can convert svn repository to mercurial repository (or use mercurial as a client to svn repo) but what I want is to convert mercurial repository to svn repository. We have some tool that uses SVNKit, and we'd like to continue use it, but want to be able to work on mercurial repository. Hence we want to completely convert mercurial repo to svn repo. Is that something that's possible? (and how?)

    Read the article

  • How to use the unit of work and repository patterns in a service oriented enviroment

    - by A. Karimi
    I've created an application framework using the unit of work and repository patterns for it's data layer. Data consumer layers such as presentation depend on the data layer design. For example a CRUD abstract form has a dependency to a repository (IRepository). This architecture works like a charm in client/server environments (Ex. a WPF application and a SQL Server). But I'm looking for a good pattern to change or reuse this architecture for a service oriented environment. Of course I have some ideas: Idea 1: The "Adapter" design pattern Keep the current architecture and create a new unit of work and repository implementation which can work with a service instead of the ORM. Data layer consumers are loosely coupled to the data layer so it's possible but the problem is about the unit of work; I have to create a context which tracks the objects state at the client side and sends the changes to the server side on calling the "Commit" (Something that I think the RIA has done for Silverlight). Here the diagram: ----------- CLIENT----------- | ------------------ SERVER ---------------------- [ UI ] -> [ UoW/Repository ] ---> [ Web Services ] -> [ UoW/Repository ] -> [DB] Idea 2: Add another layer Add another layer (let say "local services" or "data provider"), then put it between the data layer (unit of work and repository) and the data consumer layers (like UI). Then I have to rewrite the consumer classes (CRUD and other classes which are dependent to IRepository) to depend on another interface. And the diagram: ----------------- CLIENT ------------------ | ------------------- SERVER --------------------- [ UI ] -> [ Local Services/Data Provider ] ---> [ Web Services ] -> [ UoW/Repository ] -> [DB] Please note that I have the local services layer on the current architecture but it doesn't expose the data layer functionality. In another word the UI layer can communicate with both of the data and local services layers whereas the local services layer also uses the data layer. | | | | | | | | ---> | Local Services | ---> | | | UI | | | | Data | | | | | | | ----------------------------> | |

    Read the article

  • Should an object know its own ID?

    - by xenoterracide
    obj.id seems fairly common and also seems to fall within the range of something an object could know about itself. I find myself asking why should my object know its own id? It doesn't seem to have a reason to have it? One of the main reason for it existing is retrieve it, and so my repositories need to know it, and thus use it for database interaction. I also once encountered a problem where I wanted to serialize an object to JSON for a RESTful API where the id did not seem to fit in the payload, but only the URI and including it in the object made that more difficult. Should an object know it's own id? why or why not?

    Read the article

  • Object oriented design importance

    - by user5507
    I started studying Object Oriented Design and Modelling using the this book by James Rumbaugh. It uses a tool called Object Modeling Technique (OMT). I have certain newbie questions. I searched the net, but couldn't get answers The book is pretty old. Don't know why the school told me to learn this. I know OMT is a predecessor of the Unified Modeling Language (UML). So its a waste? Whether the concepts change very much when we move from OMT to UML? I know OMT has Object, Dynamic and Functional Model. Wikipedia says UML is compatible with OMT and UML is a model too. As per wikipedia the UML models are Static and Dynamic and they are represented by different diagrams like class, object, activity, sequence..... I couldn't find the equivalence of this in OMT. I read that there are many object oriented development methods like OMT, Booch,.... Which one is used by Industry ? Where could I get a comparison of different Object oriented development methods?

    Read the article

  • Setting Up Git Repository on Remote Windows Server?

    - by Goober
    I have a windows server which I can access locally or remotely over the internet through remote desktop connection, etc. I want to set up a git repository (something similar to "trunk" in subversion), that can contain a series of repositories for multiple projects. Does anyone know how I go about doing this? I want to do it using a GUI if possible. I have followed this Git Bash Tutorial but it's very long winded and not exactly what I'm after. I'm using a Git client called MSYSGIT. Using this I just want to be able to set up remote repositories and start committing source code. Any help would be greatly appreciated!

    Read the article

  • Does the "security" repository provides anything not found in the "updates" repository?

    - by netvope
    For the limited number of package I looked at (e.g. apache), I found that the package version in the updates repository is always newer than or equal to the version available in the security repository (provided that they exist). This gives me the impression that all security patches posted to the security repository are also posted to the updates repository. If this is true, I can remove all <release_name>-security entries in my apt sources.list and the <release_name>-updates entries will still give me the security patches. This will speed up apt-get update quite a bit. The best documentation I can found regarding the repositories is on the community help page "Important Security Updates (raring-security)". Patches for security vulnerabilities in Ubuntu packages. They are managed by the Ubuntu Security Team and are designed to change the behavior of the package as little as possible -- in fact, the minimum required to resolve the security problem. As a result, they tend to be very low-risk to apply and all users are urged to apply security updates. "Recommended Updates (raring-updates)". Updates for serious bugs in Ubuntu packaging that do not affect the security of the system. However, it does not mention whether the updates repository also includes everything in the security repository. Can anyone confirm (or disconfirm) this?

    Read the article

  • Object behaviour or separate class?

    - by Andrew Stephens
    When it comes to OO database access you see two common approaches - the first is to provide a class (say "Customer") with methods such as Retrieve(), Update(), Delete(), etc. The other is to keep the Customer class fairly lightweight (essentially just properties) and perform the database access elsewhere, e.g. using a repository. This choice of approaches doesn't just apply to database access, it can crop up in many different OOD scenarios. So I was wondering if one way is preferable over the other (although I suspect the answer will be "it depends")! Another dev on our team argues that to be truly OO the class should be "self-contained", i.e. providing all the methods necessary to manipulate and interact with that object. I personally prefer the repository approach - I don't like bloating the Customer class with all that functionality, and I feel it results in cleaner code having it elsewhere, but I can't help thinking I'm seriously violating core OO concepts! And what about memory implications? If I retrieve thousands of Customer objects I'm assuming those with the data access methods will take up a lot more memory than the property-only objects?

    Read the article

  • Many small scripts, one repository or multiple?

    - by The Jug
    A co-worker and myself have run into an issue that we have multiple opinions on. Currently we have a git repository that we are keeping all of our cronjobs in. There are about 20 crons and they are not really related except for the fact that they are all small python scripts and essential for some activity. We are using a fabric.py file to deploy and a requirements.txt file to manage requirements for all of the scripts. Our issue is basically, do we keep all of these scripts in one git repository or should we be separating them out into their own repositories? By keeping them in one repository it is easier to deploy them onto one server. We can use just one cron file for all the scripts. However this feels wrong, as the 20 cronjobs are not logically related. Additionally, when using one requirements.txt file for all the scripts, it's hard to figure out what the dependencies are for a particular script and they all have to use the same versions of packages. We could separate all of the scripts out into their own repositories but this creates 20 different repositories that need to be remembered and dealt with. Most of these scripts are not very large and that solution seems to be overkill. A related question is, do we use one big crontab file for all cronjobs, or a separate file for each? If each has their own, how does one crontab's installation avoid overwriting the other 19? This also seems like a pain as there would then by 20 different cron files to keep track of. In short, our main question and issue is do we keep them all closely bundled as one repository or do we separate them out into their own repository with their own requirements.txt and fabfile.py? We feel like we're also probably looking over some really simple solution. Is there an easier way to deal with this issue?

    Read the article

  • Usage of repository between EF model and code consumer

    - by jim
    I have binary data in my database that I'll have to convert to bitmap at some point. I was thinking whether or not it's appropriate to use a repository and do it there. My consumer, which is a presentation layer, will use this repository. For example: // This is a class I created for modeling the item as is. public class RealItem { public string Name { get; set; } public Bitmap Image { get; set; } } public abstract class BaseRepository { //using Unity (http://unity.codeplex.com) to inject the dependancy of entity context. [Dependency] public Context { get; set; } } public calss ItemRepository : BaseRepository { public List<Items> Select() { IEnumerable<Items> items = from item in Context.Items select item; List<RealItem> lst = new List<RealItem>(); foreach(itm in items) { MemoryStream stream = new MemoryStream(itm.Image); Bitmap image = (Bitmap)Image.FromStream(stream); RealItem ritem = new RealItem{ Name=item.Name, Image=image }; lst.Add(ritem); } return lst; } } Is this a correct way to use the repository pattern? I'm learning this pattern and I've seen a lot of examples online that are using a repository but when I looked at their source code... for example: public IQueryable<object> Select { return from q in base.Context select q; } as you can see no behavior is added to the system by their approach, so I was confused that maybe repository is something else and I got it all wrong. At the end there should be extra benifits of using them right?

    Read the article

  • Taking Object Oriented development to the next level

    - by Songo
    Can you mention some advanced OO topics or concepts that one should be aware of? I have been a developer for 2 years now and currently aiming for a certain company that requires a web developer with a minimum experience of 3 years. I imagine the interview will have the basic object oriented topics like (Abstraction, Polymorphism, Inheritance, Design patterns, UML, Databases and ORMs, SOLID principles, DRY principle, ...etc) I have these topics covered, but what I'm looking forward to is bringing up topics such as Efferent Coupling, Afferent Coupling, Instability, The law of Demeter, ...etc. Till few days ago I never knew such concepts existed (maybe because I'm a communication engineer basically not a CS graduate.) Can you please recommend some more advanced topics concerning object oriented programming?

    Read the article

  • How to use the client object model with SharePoint2010

    - by ybbest
    In SharePoint2010, you can use client object model to communicate with SharePoint server. Today, I’d like to show you how to achieve this by using the c# console application. You can download the solution here. 1. Create a Console application in visual studio and add the following references to the project. 2. Insert your code as below ClientContext context = new ClientContext("http://demo2010a"); Web currentWeb = context.Web; context.Load(currentWeb, web =&gt; web.Title); context.ExecuteQuery(); Console.WriteLine(currentWeb.Title); Console.ReadLine(); 3. Run your code then you will get the web title displayed as shown below Note: If you got the following errors, you need to change your target framework from .Net Framework 4 client profile to .Net Framework 4 as shown below: Change from TO

    Read the article

  • Any enlightenment for understanding Object Oriented Programming? [closed]

    - by ????
    I studied computer science near the end of 1980s, and wasn't taught OOP that formally. With Pascal or C, when I understand the top-down design of functions, and the idea of black box, then everything just seem to make sense, as if there is a "oh I get it!" -- some kind of totally getting it and enlightenment feeling. But with OOP, all I know was the mechanics: the class, instance, method, inheritance, polymorphism, encapsulation. It was like, I knew all the "this is how it is", but never had the feeling of "I totally get it", the enlightened feeling. Would somebody be able to describe it, or point to a chapter in some book or paper which talks about OOP so that the reader can feel: "I totally get it!" on OOP?

    Read the article

  • Can't add repository due to 'missing' fingerprint

    - by cubsink
    I am trying to install nginx with php but when I am following a guide, like this one: http://www.justincarmony.com/blog/2011/10/24/setting-up-nginx-php-fpm-on-ubuntu-10-04/ I am always told to add that repository (sudo add-apt-repository ppa:brianmercer/php) but I can't. I'll just get "Error: can't find signing_key_fingerprint at https://launchpad.net/api/1.0/~nginx/+archive/php5" and when I go to that website I find that there is a fingerprint specified but still I get that error message. Is there anyway to specify it myself? And for the last thing, how I can fix this so I can continue my installation towards a working nginx enviroment with php. Thanks for your advice and better wisdom.

    Read the article

  • add-apt-repository not working UbuntuGnome 12.10

    - by nickcannariato
    When I try to add a ppa using the command: sudo add-apt-repository [insert ppa] the output I get is: Error in sitecustomize; set PYTHONVERBOSE for traceback: EOFError: EOF read where not expected Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 3, in <module> from __future__ import print_function EOFError: EOF read where not expected This is the desktop version. It's a clean install and I didn't get any log errors on install. I haven't added or removed any python versions. Can someone set me straight on how to fix this?

    Read the article

  • c#Repository pattern: One repository per subclass?

    - by Alex
    I am wondering if you would create a repository for each subclass of a domain model. There are two classes for example: public class Person { public virtual String GivenName { set; get; } public virtual String FamilyName { set; get; } public virtual String EMailAdress { set; get; } } public class Customer : Person { public virtual DateTime RegistrationDate { get; set; } public virtual String Password { get; set; } } Would you create both a PersonRepository and a CustomerRepository or just the PersonRepository which would also be able to execute Customer related queries?

    Read the article

  • apt-get doesn't see packages in my trivial repository

    - by lorin
    I've tried to set up a trivial repository with binary .debs for internal use, but apt-get doesn't see the packages. I've done the following: On the web server: Created the binary debs with dpkg-buildpackage Put all of the binary debs in a web-accessible directory which corresponds to http://www.example.com/packages Generated a Packages.gz file in the same directory by doing: dpkg-scansources . /dev/null | gzip -9c > Packages.gz On the client machine: Added the following line to my /etc/apt/sources.list file: deb http://www.example.com/packages / Ran: sudo apt-get update The output related to my trivial repository looked like this: Ign http://www.example.com Release.gpg Ign http://www.example.com/packages/ Translation-en_US Ign http://www.example.com Release Ign http://www.example.com Packages Ign http://www.example.com Packages Hit http://www.example.com Packages But I can't install the package by name. For example, there's a package called "python-nova" which corresponds to package python-nova_2011.3-custom~bzr680-0ubuntu1_all.deb I've tried to do: apt-get install python-nova, but I get the following error: $ sudo apt-get install python-nova Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package python-nova

    Read the article

  • Update Manager Not working Fail to Download Repository Information

    - by user51564
    When I try to update, I get this error: Failed to Download your repository information Check your internet connection W:GPG error: http ://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4874D3686E80C6B7, W:Failed to fetch http://ppa.launchpad.net/pmcenery/ppa/ubuntu/dists/oneiric/main/source/Sources 404 Not Found W:Failed to fetch http://ppa.launchpad.net/pmcenery/ppa/ubuntu/dists/oneiric/main/binary-i386/Packages 404 Not Found E:Some index files failed to download. They have been ignored, or old ones used instead.

    Read the article

  • update manager is not woring Failed to download repository information

    - by harry
    My update manager is not working and showing this message Failed to download repository information Check your Internet connection. W:Failed to fetch http://ppa.launchpad.net/pmcenery/ppa/ubuntu/dists/precise/main/source/Sources 404 Not Found , W:Failed to fetch http://ppa.launchpad.net/pmcenery/ppa/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found , E:Some index files failed to download. They have been ignored, or old ones used instead. Pleas help Thank you for your time.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >