Search Results

Search found 10046 results on 402 pages for 'repository pattern'.

Page 16/402 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Update Nexus repository with local artifacts

    - by mamuesstack
    Hi, i recently downloaded some maven artifacts directly to my local repository (.m2/repository). Now i installed the Nexus Repository Manager and need to fill its storage without to download all the artifacts again. Is there a way to update the Nexus repository with the local one. I don't want to simply copy them because Nexus separate artifacts concerning their public servers (central, codehaus, etc.) and the local repository structure doesn't. Update: Meanwhile i copied the the artifacts from the local repository to the Nexus storage (public repository). I can browse to the artifacts via the Nexus webapp, but Maven somehow can't resolve the artifacts from Nexus. Do i need to register them particularly? I re-indexed the public repository and restarted Nexus multiple times - no changes.

    Read the article

  • I can't use achiva as a proxy of my remote repository

    - by user1553915
    I want to install Achiva to manage my Maven repositories. I add a new internal repository called "public" and a new remote repository, which is my company's repository. Then I configure the proxy connector to let the repository "public" to be a proxy of the remote one. But When I enter the address "http://localhost:8084/archiva/repository/public/.../....pom" in the web brower,error occurred "Unable to fetch artifact resource". However, if I replace the remote repository with another one such as "http://repository.codehaus.org/", the proxy works. I don't know why this happens, are there something wrong with my remote repository address?

    Read the article

  • Generic Repositories with DI & Data Intensive Controllers

    - by James
    Usually, I consider a large number of parameters as an alarm bell that there may be a design problem somewhere. I am using a Generic Repository for an ASP.NET application and have a Controller with a growing number of parameters. public class GenericRepository<T> : IRepository<T> where T : class { protected DbContext Context { get; set; } protected DbSet<T> DbSet { get; set; } public GenericRepository(DbContext context) { Context = context; DbSet = context.Set<T>(); } ...//methods excluded to keep the question readable } I am using a DI container to pass in the DbContext to the generic repository. So far, this has met my needs and there are no other concrete implmentations of IRepository<T>. However, I had to create a dashboard which uses data from many Entities. There was also a form containing a couple of dropdown lists. Now using the generic repository this makes the parameter requirments grow quickly. The Controller will end up being something like public HomeController(IRepository<EntityOne> entityOneRepository, IRepository<EntityTwo> entityTwoRepository, IRepository<EntityThree> entityThreeRepository, IRepository<EntityFour> entityFourRepository, ILogError logError, ICurrentUser currentUser) { } It has about 6 IRepositories plus a few others to include the required data and the dropdown list options. In my mind this is too many parameters. From a performance point of view, there is only 1 DBContext per request and the DI container will serve the same DbContext to all of the Repositories. From a code standards/readability point of view it's ugly. Is there a better way to handle this situation? Its a real world project with real world time constraints so I will not dwell on it too long, but from a learning perspective it would be good to see how such situations are handled by others.

    Read the article

  • Which is more important in a web application code promotion hierarchy? production environment to repo equivalence or unidirectional propagation?

    - by ghbarratt
    Lets say you have a code promotion hierarchy consisting of several environments, (the polar end) two of which are development (dev) and production (prod). Lets say you also have a web application where important (but not developer controlled) files are created (and perhaps altered) in the production environment. Lets say that you (or someone above you) decided that the files which are controlled/created/altered/deleted in the production environment needed to go into the repository. Which of the following two sets of practice / approaches do you find best: Committing these non-developed file modifications made in the production environment so that the repository reflects the production environment as closely and as often as possible. Generally ignoring the non-developed production environment alterations, placing confidence in backups to restore the production environment should it be harmed, and keeping a resolution to avoid pushing developments through the promotion hierarchy in the reverse direction (avoiding pushing from prod to dev), only committing the files found in the production environment if they were absolutely necessary in other environments for development. So, 1 or 2, and why? PS - I am currently slightly biased toward maintaining production environment to repository equivalence (option 1), but I keep an open mind and would accept an answer supporting either.

    Read the article

  • Noob with git repository on Windows Storage Server 2008?

    - by HibbyHoo
    I have a Western Digital Sentinel at home running Windows Storage Server 2008 R2 Essentials. I have several git repositories on it for my own personal projects, and have no problem pushing and pulling over my local network. I want to be able to access those repos remotely from anywhere. I am able to log in and remotely access folders and files on it, but I cannot clone repos using the same address. It hangs for a REALLY long time before finally failing with an error: git.exe clone --progress -v "https://myIpAddressHere/Remote/fs/files.aspx?path=%5C%5Cmydevicename%5Cmyreposfolder%5Cmyrepo.git" "D:\repo" Cloning into 'D:\repo'... error: Failed connect to myIpAddress:443; No error while accessing https://myIpAddress/Remote/fs/files.aspx?path=%5C%5Cmydevicename%5Cmyreposfolder%5Cmyrepo.git/info/refs fatal: HTTP request failed git did not exit cleanly (exit code 128) I'm not too privy to networking or web development, and I have only a rudimentary understanding of how to use git (with TortoiseGit). I'm having a hard time finding search results for this specific problem and a hard time interpreting generic tutorials for the general scope of this problem. TortoiseGit version: 1.7.13.0. git version: 1.7.10.mysysgit.1.

    Read the article

  • Unable to use stored procs in a generic repository for the entity framework. (ASP.NET MVC 2)

    - by Matt
    Hi, I have a generic repository that uses the entity framework to manipulate the database. The original code is credited to Morshed Anwar's post on CodeProject. I've taken his code and modified is slightly to fit my needs. Unfortunately I'm unable to call an Imported Function because the function is only recognized for my specific instance of the entity framework public class Repository<E, C> : IRepository<E, C>, IDisposable where E : EntityObject where C : ObjectContext { private readonly C _ctx; public ObjectResult<MyObject> CallFunction() { // This does not work because "CallSomeImportedFunction" only works on // My object. I also cannot cast it (TrackItDBEntities)_ctx.CallSomeImportedFunction(); // Not really sure why though... but either way that kind of ruins the genericness off it. return _ctx.CallSomeImportedFunction(); } } Anyone know how I can make this work with the repository I already have? Or does anyone know a generic way of calling stored procedures with entity framework? Thanks, Matt

    Read the article

  • How to use StructureMap to inject repository classes to the controller?

    - by Lorenzo
    In the current application I am working on I have a custom ControllerFactory class that create a controller and automatically sets the Elmah ErrorHandler. public class BaseControllerFactory : DefaultControllerFactory { public override IController CreateController( RequestContext requestContext, string controllerName ) { var controller = base.CreateController( requestContext, controllerName ); var c = controller as Controller; if ( c != null ) { c.ActionInvoker = new ErrorHandlingActionInvoker( new HandleErrorWithElmahAttribute() ); } return controller; } protected override IController GetControllerInstance( RequestContext requestContext, Type controllerType ) { try { if ( ( requestContext == null ) || ( controllerType == null ) ) return base.GetControllerInstance( requestContext, controllerType ); return (Controller)ObjectFactory.GetInstance( controllerType ); } catch ( StructureMapException ) { System.Diagnostics.Debug.WriteLine( ObjectFactory.WhatDoIHave() ); throw new Exception( ObjectFactory.WhatDoIHave() ); } } } I would like to use StructureMap to inject some code in my controllers. For example I would like to automatically inject repository classes in them. I have already created my repository classes and also I have added a constructor to the controller that receive the repository class public FirmController( IContactRepository contactRepository ) { _contactRepository = contactRepository; } I have then registered the type within StructureMap ObjectFactory.Initialize( x => { x.For<IContactRepository>().Use<MyContactRepository>(); }); How should I change the code in the CreateController method to have the IContactRepository concrete class injected in the FirmController? EDIT: I have changed the BaseControllerFactory to use Structuremap. But I get an exception on the line return (Controller)ObjectFactory.GetInstance( controllerType ); Any hint?

    Read the article

  • Pattern for Accessing MySQL connection

    - by Dipan Mehta
    We have an application which is C++ trying to access MySQL database. There are several (about 5 or so) threads in the application (with Boost library for threading) and in each thread has a few objects, each of which is trying to access Database for its' own purpose. It has a simple ORM kind of model but that really is not an important factor here. There are three potential access patterns i can think of: There could be single connection object per application or thread and is shared between all (or group). The object needs to be thread safe and there will be contentions but MySQL will not be fired with too many connections. Every object could initiate connection on its own. The database needs to take care of concurrency (which i think MySQL can) and the design could be much simpler. There could be two possibilities here. a. either object keeps a persistent connection for its life OR b. object initiate connection as and when needed. To simplify the contention as in case of 1 and not to create too many sockets as in case of 2, we can have group/set based connections. So there could be there could be more than one connection (say N), each of this connection could be shared connection across M objects. Naturally, each of the pattern has different resource cost and would work under different constraints and objectives. What criteria should i use to choose the pattern of this for my own application? What are some of the advantages and disadvantages of each of these pattern over the other? Are there any other pattern which is better? PS: I have been through these questions: mysql, one connection vs multiple and MySQL with mutiple threads and processes But they don't quite answer exactly what i am trying to ask.

    Read the article

  • Using visitor pattern with large object hierarchy

    - by T. Fabre
    Context I've been using with a hierarchy of objects (an expression tree) a "pseudo" visitor pattern (pseudo, as in it does not use double dispatch) : public interface MyInterface { void Accept(SomeClass operationClass); } public class MyImpl : MyInterface { public void Accept(SomeClass operationClass) { operationClass.DoSomething(); operationClass.DoSomethingElse(); // ... and so on ... } } This design was, however questionnable, pretty comfortable since the number of implementations of MyInterface is significant (~50 or more) and I didn't need to add extra operations. Each implementation is unique (it's a different expression or operator), and some are composites (ie, operator nodes that will contain other operator/leaf nodes). Traversal is currently performed by calling the Accept operation on the root node of the tree, which in turns calls Accept on each of its child nodes, which in turn... and so on... But the time has come where I need to add a new operation, such as pretty printing : public class MyImpl : MyInterface { // Property does not come from MyInterface public string SomeProperty { get; set; } public void Accept(SomeClass operationClass) { operationClass.DoSomething(); operationClass.DoSomethingElse(); // ... and so on ... } public void Accept(SomePrettyPrinter printer) { printer.PrettyPrint(this.SomeProperty); } } I basically see two options : Keep the same design, adding a new method for my operation to each derived class, at the expense of maintainibility (not an option, IMHO) Use the "true" Visitor pattern, at the expense of extensibility (not an option, as I expect to have more implementations coming along the way...), with about 50+ overloads of the Visit method, each one matching a specific implementation ? Question Would you recommand using the Visitor pattern ? Is there any other pattern that could help solve this issue ?

    Read the article

  • MVC Architecture

    Model-View-Controller (MVC) is an architectural design pattern first written about and implemented by  in 1978. Trygve developed this pattern during the year he spent working with Xerox PARC on a small talk application. According to Trygve, “The essential purpose of MVC is to bridge the gap between the human user's mental model and the digital model that exists in the computer. The ideal MVC solution supports the user illusion of seeing and manipulating the domain information directly. The structure is useful if the user needs to see the same model element simultaneously in different contexts and/or from different viewpoints.”  Trygve Reenskaug on MVC The MVC pattern is composed of 3 core components. Model View Controller The Model component referenced in the MVC pattern pertains to the encapsulation of core application data and functionality. The primary goal of the model is to maintain its independence from the View and Controller components which together form the user interface of the application. The View component retrieves data from the Model and displays it to the user. The View component represents the output of the application to the user. Traditionally the View has read-only access to the Model component because it should not change the Model’s data. The Controller component receives and translates input to requests on the Model or View components. The Controller is responsible for requesting methods on the model that can change the state of the model. The primary benefit to using MVC as an architectural pattern in a project compared to other patterns is flexibility. The flexibility of MVC is due to the distinct separation of concerns it establishes with three distinct components.  Because of the distinct separation between the components interaction is limited through the use of interfaces instead of classes. This allows each of the components to be hot swappable when the needs of the application change or needs of availability change. MVC can easily be applied to C# and the .Net Framework. In fact, Microsoft created a MVC project template that will allow new project of this type to be created with the standard MVC structure in place before any coding begins. The project also creates folders for the three key components along with default Model, View and Controller classed added to the project. Personally I think that MVC is a great pattern in regards to dealing with web applications because they could be viewed from a myriad of devices. Examples of devices include: standard web browsers, text only web browsers, mobile phones, smart phones, IPads, IPhones just to get started. Due to the potentially increasing accessibility needs and the ability for components to be hot swappable is a perfect fit because the core functionality of the application can be retained and the View component can be altered based on the client’s environment and the View component could be swapped out based on the calling device so that the display is targeted to that specific device.

    Read the article

  • A question about "add-apt-repository"(gcc 4.7 or bumblebee)

    - by girlkoo
    I install ubuntu 12.04 in my notebook and I use c++. I want to use c++11,so I want to upgrade my gcc to gcc4.7. I do like this: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.7 sudo apt-get install g++-4.7 but when I run "sudo apt-get install gcc-4.7", it just can find gcc-4.7-base not gcc-4.7, and when I run "sudo apt-get install g++-4.7", it can find nothing... Today, I want to install the "bumblebee" and do like this: sudo add-apt-repository ppa:bumblebee/stable sudo apt-get update sudo apt-get install bumblebee bumblebee-nvidia sudo reboot but when I run "sudo apt-get install bumblebee bumblebee-nvidia", it tells me the packages can't be find. The ways I methoded are specially use to ubuntu 12.04, the links is: Installing gcc 4.7 https://wiki.ubuntu.com/Bumblebee#Installation What can I do? Thank you!My email is [email protected]

    Read the article

  • How to cleanup a Local Repository?

    - by maythux
    In my local repository each time i update the packages inside. The problem is: I have many versions of the same package. so, i need to delete the old versions in some way.(don't tell me to do it manually!!) Any ideas?!! Maybe a script that checks the version of each package keeping the newer version and deletind older ones can solve this issue. I am seeking for such script or if some software is founded would be great UPDATE: See this for how to make a local repository

    Read the article

  • Adding Debian Sid as Package Repository?

    - by user1131467
    I am running 12.04 Precise beta (upgraded from 11.10 Oneiric) and I added the following line to my /etc/apt/source.list: deb http://http.us.debian.org/debian unstable main contrib non-free In order to get a newer version of a package (octave 3.6) that I needed but was not available in the precise repository. This worked fine, but now when I want to upgrade there is a large number of packages that need to get updated. I assume this is because sid has newer versions of many of the packages than precise. I've temporarily disabled the sid repository, and this works fine - however I am curious to know what would happen if I allowed all those upgrades to go through? Would it break my system? Are the structures of Ubuntu Precise and Debian Sid repositories fundamentally different somehow?

    Read the article

  • iOS - Unit tests for KVO/delegate codes

    - by ZhangChn
    I am going to design a MVC pattern. It could be either designed as a delegate pattern, or a Key-Value-Observing(KVO), to notify the controller about changing models. The project requires certain quality control procedures to conform to those verification documents. My questions: Does delegate pattern fit better for unit testing than KVO? If KVO fits better, would you please suggest some sample codes?

    Read the article

  • Building a Repository Pattern against an EF 5 EDMX Model - Part 1

    - by Juan
    I am part of a year long plus project that is re-writing an existing application for a client.  We have decided to develop the project using Visual Studio 2012 and .NET 4.5.  The project will be using a number of technologies and patterns to include Entity Framework 5, WCF Services, and WPF for the client UI.This is my attempt at documenting some of the successes and failures that I will be coming across in the development of the application.In building the data access layer we have to access a database that has already been designed by a dedicated dba. The dba insists on using Stored Procedures which has made the use of EF a little more difficult.  He will not allow direct table access but we did manage to get him to allow us to use Views.  Since EF 5 does not have good support to do Code First with Stored Procedures, my option was to create a model (EDMX) against the existing database views.   I then had to go select each entity and map the Insert/Update/Delete functions to their respective stored procedure. The next step after I had completed mapping the stored procedures to the entities in the EDMX model was to figure out how to build a generic repository that would work well with Entity Framework 5.  After reading the blog posts below, I adopted much of their code with some changes to allow for the use of Ninject for dependency injection.http://www.tcscblog.com/2012/06/22/entity-framework-generic-repository/ http://www.tugberkugurlu.com/archive/generic-repository-pattern-entity-framework-asp-net-mvc-and-unit-testing-triangle IRepository.cs public interface IRepository : IDisposable where T : class { void Add(T entity); void Update(T entity, int id); T GetById(object key); IQueryable Query(Expression> predicate); IQueryable GetAll(); int SaveChanges(); int SaveChanges(bool validateEntities); } GenericRepository.cs public abstract class GenericRepository : IRepository where T : class { public abstract void Add(T entity); public abstract void Update(T entity, int id); public abstract T GetById(object key); public abstract IQueryable Query(Expression> predicate); public abstract IQueryable GetAll(); public int SaveChanges() { return SaveChanges(true); } public abstract int SaveChanges(bool validateEntities); public abstract void Dispose(); } One of the issues I ran into was trying to do an update. I kept receiving errors so I posted a question on Stack Overflow http://stackoverflow.com/questions/12585664/an-object-with-the-same-key-already-exists-in-the-objectstatemanager-the-object and came up with the following hack. If someone has a better way, please let me know. DbContextRepository.cs public class DbContextRepository : GenericRepository where T : class { protected DbContext Context; protected DbSet DbSet; public DbContextRepository(DbContext context) { if (context == null) throw new ArgumentException("context"); Context = context; DbSet = Context.Set(); } public override void Add(T entity) { if (entity == null) throw new ArgumentException("Cannot add a null entity."); DbSet.Add(entity); } public override void Update(T entity, int id) { if (entity == null) throw new ArgumentException("Cannot update a null entity."); var entry = Context.Entry(entity); if (entry.State == EntityState.Detached) { var attachedEntity = DbSet.Find(id); // Need to have access to key if (attachedEntity != null) { var attachedEntry = Context.Entry(attachedEntity); attachedEntry.CurrentValues.SetValues(entity); } else { entry.State = EntityState.Modified; // This should attach entity } } } public override T GetById(object key) { return DbSet.Find(key); } public override IQueryable Query(Expression> predicate) { return DbSet.Where(predicate); } public override IQueryable GetAll() { return Context.Set(); } public override int SaveChanges(bool validateEntities) { Context.Configuration.ValidateOnSaveEnabled = validateEntities; return Context.SaveChanges(); } #region IDisposable implementation public override void Dispose() { if (Context != null) { Context.Dispose(); GC.SuppressFinalize(this); } } #endregion IDisposable implementation } At this point I am able to start creating individual repositories that are needed and add a Unit of Work.  Stay tuned for the next installment in my path to creating a Repository Pattern against EF5.

    Read the article

  • Get your picture on the screen at MIX11: Help me create a repository of sample data

    - by Laurent Bugnion
    Here is your chance to get your picture on the big screen during my MIX11 presentation in April this year. I need to create a small repository of sample data for my demos. So instead of tapping in my imagination and creating dummy users (or reusing past information I already used in other demos), I thought I would appeal to the amazing community: Send me an email with the following information. I will include the first 30 users into my sample data repository and use your info in my demo. First Name Last Name Date of birth Picture Link to Facebook profile (optional) Disclaimer: The data will only be running locally on my hard drive. The demos will however be filmed and the videos made public. By providing this information, you explicitly consent to this data being used in demos at MIX11 and possibly in following conferences. The data will only be used for demo purposes. Thanks for your help!!   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • How to lower wait time for repository updates

    - by Luis
    When doing a aptitude update / apt-get update or using the Update Manager to update sometimes I get to a repository link that takes too long. The percent does not end and it takes quite a while before it ignores it. How can I lower the time so that if a particular repository takes more than 10 seconds to connect or finish it should ignore it and move the following ones. Here is an image explaining the problem: It is trying to connect to archive.ubuntu.com but since it is taking too long it just sits there for at least 3 to 5 minutes (Haven't measured the time) and then it shows as ignored and moves to the following. I wish to change that to seconds instead of minutes.

    Read the article

  • DDD: service contains two repository

    - by tikhop
    Does it correct way to have two repository inside one service and will it be an application or domain service? Suppose I have a Passenger object that should contains Passport (government id) object. I am getting Passenger from PassengerRepository. PassengerRepository create request to server and obtain data (json) than parse received data and store inside repository. I have confused because I want to store Passport as Entity and put it to PassportRepository but all information about password contains inside json than i received above. I guess that I should create a PassengerService that will be include PassengerRepository and PassportRepository with several methods like removePassport, addPassport, getAllPassenger and etc. UPDATE: So I guess that the better way is represent Passport as VO and store all passports inside Passenger aggregate. However there is another question: Where I should put the methods (methods calls server api) for management passenger's passport. I think the better place is so within Passenger aggregate.

    Read the article

  • A c# Generics question involving Controllers and Repositories

    - by UpTheCreek
    I have a base repository class which contains all the common repository methods (as generic): public abstract class BaseRepository<T, IdType> : IBaseRepository<T, IdType> My repositories from this base e.g.: public class UserRepository : BaseRepository<User, int>, IUserRepository I also have a base controller class containing common actions, and inherit from this in controllers. The repository is injected into this by DI. E.g. public class UserController : BaseController<User> { private readonly IUserRepository userRepository; public UserController (IUserRepository userRepository) { this.userRepository= userRepository; } My question is this: The base controller needs to be able to access the repository methods that are defined in the base repository. However I'm passing in via DI a different repository type for each controller (even though they all inherrit from the base repository). How can the base controller somehow access the repository that is passed in (regardless of what type it is), so that it can access the common base methods?

    Read the article

  • Ranking based string matching algorithm..for Midi Music

    - by Taha
    i am working on midi music project. What i am trying to do is:- matching the Instrument midi track with the similar instrument midi track... for example Flute track in a some midi music is matched against the Flute track in some other music midi file... After matching ,the results should come ranking wise according to their similarity.. Like 1) track1 2) track2 3) track3 I have this sort of string coming from my midi music .. F4/0.01282051282051282E4/0.01282051282051282Eb4/0.01282051282051282 D4/0.01282051282051282C#4/0.01282051282051282C4/0.01282051282051282 Which ranking algorithm with good metrics should i use for such data ? Thanking you in anticipation!

    Read the article

  • How to rebase one Git repository onto another one?

    - by kroimon
    Hi there! I had one Git repository (A) which contains the development of a project until a certain point. Then I lost the USB stick this repo A was on. Luckily I had a backup of the latest commit, so I could create a new repository (B) later where I imported the latest project's state and continue development. Now I recovered that lost USB stick, so I have two Git repositories. I think I just have to rebase repo B onto repo A somehow, but I have no idea how to do that, maybe using fetch/pull and rebase? Thanks in advance for your help!

    Read the article

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