質問

I've scoured the internet, several books, and even consulted some peers. Nothing really states if what I'm attempting to do is bad practice or not. The short; is I'm just doing a fire-and-forget from the client.

[ServiceContract]
public interface ICustomerInformation
{

       [OperationContract(IsOneWay = true, IsTerminating = true, IsInitiating = false)]
       ICustomerAccount GetCustomerDetails (string First);

}

[DataContract]
public interface ICustomerAccount
{
      _firstName = firstName;

      [DataMember]
      string FirstName 
      {
            get { return _firstName; }
            set { _firstName = value; }
      }
}

My original thought was an implementation similar to this to abstract the properties; so the server and application tied to the server could make use of these properties. But is that really a smart thing to do? Or even good practice?

My assumption was; by adding this layer to the service it will allow user interfaces accessing the service to simply push it's data; while allowing the functionality to tie straight into the data. So if a users data changes, the service will change it for the functionality on the server.

Is that a bad way to view? Or attempt this? Am I misguided on this interpretation?

Like I said above; the goal is a logical abstraction where multiple styles of interfaces push its data to the service. The service then takes the input; performs a function based on those variable input values.

If I've worded it poorly let me know so I can edit; or think of a better means of explanation. Any assistance would be great.


Update:

I'm trying to create a universal interface; where any application or client interface for that matter inputs data. Once the data is submitted to the service; the server takes it. No data needs to be returned; but the server just runs through commands utilizing the client side information.

Essentially, I'm attempting to make data universally pushed through the service for the server to do task. The client doesn't need to be aware of any of the server task that it's doing.

My thought process was to logically separate UI / user input through the service; then the service invokes server side functions with information it gathered from the user.

Example: Textbox(Name) --> Service --> Server stores Name as variable to perform a series of task: Write Name to database, name textfile by user name, and so on.

役に立ちましたか?

解決

If I understand correctly, it seems like you want to implement some sort of message/command passing model, which seems completely legitimate to me. Take a look at this article for instance that talks about utilizing commands as architectural pattern. Those commands can be serialized over the wire from client to (WCF) service which allows you to create a highly maintainable service layer (as explained here). So back to your original question: yes this seems like a legitimate model to use. Though I would advise to read those articles. They might give you some more background on these kinds of models.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top