داستان آبیدیک

namespace


فارسی

1 کامپیوتر و شبکه:: فضای نام، فضای نام

Because all of these namespaces are open to extension, this specification imposes some rules on the construction of these names so that independent organisations may create extensions without fear of name collision. ■ Uniform Resource Names (URNs) [RFC2141] in the oid namespace that begin with a Private Enterprise Number (PEN). ■ Uniform Resource Names (URNs) [RFC2141] in the epc or epcglobal namespace, other than URIs used to represent EPCs [TDS1.9]. Event Type names and Event Field names are represented as namespace-qualified names (qnames), consisting of a namespace URI and a name. (In this example, it is assumed that PostHaste Shipping has registered the URN namespace "posthaste" with IANA.)،welcome back so the next thing that we need to kind of complete are all the texts we have done here is come to a domain service and application service on the core now I could split those into two projects but I don't want to do that I'm actually going to instead just make two folders in here to kind of explain one folder is going to contain all the information for the application service and the other folder is going to contain all the information for the domain service and that's pretty much because in my case I know that when I start Using the core right here I'm going to end up needing both anyways so that's kind of why I want to do that so let's just try and do this I will go into the custom app core I'll right-click on that Project and I'll say add new folder and I'm going to call that domain what domain service right just like we have over here in the text and I'm going to add another folder and I'm going to call That application service so it's pretty Much just a way for me as developer both now and in the future to check my code and see application service couldn't should contain the services for working with UI domain service should contain The code for kind of working with the Infrastructure pretty much meaning that Whenever we're working with whenever we Have coding the domain service it should be something that helps me talking down here in the domain service right and Whenever I have code inside the application services it should be Information that helps me communicate up here again I think it'll make sense as we start building this application having some real code examples but that's kind of why you do it yep back to the code now this pretty Much means that we're going to get some Very specific namespaces now what is a Namespace this is actually namespace and right now you'll notice that for this namespace right here is just called console app 2017 and that's actually the name of the project right here that's how you name a namespace so for instance our customer here he'll be called with The namespace customer app core entity right so that's the customer we have right here but this customer down here for instance he'll have another one he'll just have console Ava's namespace as well because he's right below the Console app now this is valuable because we can have the same class name but in two different namespaces so your namespaces should be unique that's also of add the custom app in front of my different projects to make sure that it's the customer app that I'm building a lot of people use their company name because that should be unique globally right so that's kind of why you want to Make a good project name so your namespaces are also pretty amazing if you want to change those later on you Can go under options or properties and then you can see right here default name space and then you can just change that into something else if you want to later On so it pretty much means that if we go Back to a program right now you'll Notice that right now I'm still using because these guys are in the same namespace the console app and the customer they're in the same namespace it pretty much means that I don't have to put in a namespace up here to use Them okay but if I went in here and said the customer was actually in another namespace called Dingo there we go let's just save that capitalized e that's the way they wanted Internet you would notice that the Program wouldn't know about the customer anymore you start getting errors now this customer he can actually now be imported from two different namespaces he can be Imported from the dingo namespace I just Created or it could be imported from the core entity namespace that I'm going to use in the future but notice one thing Right here if I control a command dot this guy he'll only show the dingo version for now it actually has the Reference right here but in order to do that I need to also add a reference to That project so to use namespaces from other projects I'm going to start of Course needing a dependency but for using a namespace inside my same the same project I can use just a namespace directly what does that mean well if you go in here and just import dingo again to kind of make this not break that much you'll see I get a using statement up here calling dingo right so now I can read as a developer where this file is actually located if I want to and I can also kind of decide if this is the right Namespace if this is the right customer file that I actually want to use it's Not in this case let's just remove that because the one I actually want to use is actually instead from up here this Project right here but in order to get access to that project from this project I have to again add a depend see so it depends your edit reference and I'll say I need to have access to the entity package for now not the core I don't need that for now I'll get it later so just say ok here now I have access to this project and that means that if I Again if I command dot this guy you'll see that I can actually now pick from both of these projects right here and I Want the core entity project there we go save this and now it's up here as the core entity project right that pretty much means that when I start Used to new customer from this project I don't need the customer down here and anymore so I just kind of cleaned up Some of the mess that we had let's just get rid of that and that's pretty much just the idea behind namespaces now the reason I'm telling you this is because I added these two folders I'll also get two different namespaces for these two Guys so whenever I create a file now for the domain service let me just try and create a fake file right here fig one there we go notice the name space will not only be Customer core it'll actually be customer core and then the name of the folder domain service so whenever I now create a new file let's just do it in the other one let's call it fake to whatever I Create a new file it'll actually get the name space will end with the name of the Actual folder in here and you could just keep doing that with folders and folders And cetera so that's pretty cool that's pretty amazing that means that now I can as a developer read if this is something that belongs in the application service or if it's something that belongs in the domain service again just trying to explain to other developers the idea behind this so whenever I look at the domain services should be stuff that Talks to my infrastructure and whenever I talk to application service it should be stuff that talk to my front end or the you are the rest api of my Application that's pretty much the basic idea between these two different service folders I just added right here so in the next lesson we're going to have a Talk about the first thing we're going To place in here the first pattern we're going to use which is going to be the repository pattern see you next time. been created even though the only thing that happens is he gets a new ID now again it's up to you can also just return void right here to say you don't want to return the customer when he's Done we also need to somehow be able to read data now the easiest thing we can Read is a single customer right so we can say customer and we'll say read by ID just to explain that we're going to read this customer by the way my B key doesn't work all the time so you'll have to live with that and we'll pass in an ID and then hopefully we'll get a customer back notice how simple that is again I don't do the implementation I just explained the contract the next thing I'll do is I'll also add one that can read all customers now let's just Start out by putting all these customers inside a list which is a generic guy that we already used the static list that we used in the last series and again let's just import this collection generic because that's the namespace that the list is coming from so I can actually see right here this is from system collection so this is a Microsoft class right here that they made for me sweet and let's just say how do we do that well let's just call it read all that's just meaning that you have to implement something if you want to use my interface call read all so you can get all customers back we also have an Update how do we update a customer well Again is up to you but I'm going to Return the customer after he's updated I'm not going to cost me anything so I'll just do that and then I'm going to pass in a customer containing all the information so this is the customer Update right so this is going to be the Customer that I pass in from the outside and then at some point when it's done updating the data source it's going to Return that updated customer for me the last thing that I want to do is I want to be able to delete a customer and again I'm just going to do it like this I'm going to say pass in instance your value with the customer that you want to delete the idea of the guy and then you are golden that's all I have to do now I actually have a customer repository ready to use pretty Much meaning that the interface the contract is ready to use so I can actually work I can keep Working now with my application right here and I can actually also right now If we wanted to I could move my code down to the infrastructure and start Adding the static list that we had Earlier or some kind of fake database let's actually try and do that in the next lesson so you guys can see us using this customer repository right here see You next time have fun.

واژگان شبکه مترجمین ایران


معنی‌های پیشنهادی کاربران

نام و نام خانوادگی
شماره تلفن همراه
متن معنی یا پیشنهاد شما
Captcha Code